We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function fn (x, y) { console.log(x, y, arguments); arguments[0] = 100; y = 200; console.log(x, y, arguments); } fn(10, 20);
看打印结果可以知道,在非严格模式下,实参arguments和形参x, y是有映射关系的,改其中一个,另一个会跟着改
arguments
x
y
function fn (x, y) { "use strict" console.log(x, y, arguments); arguments[0] = 100; y = 200; console.log(x, y, arguments); } fn(10, 20);
而在严格模式下,,实参arguments和形参x, y是没有映射的,所以改了arguments[0],x并不会跟着改;改了y,arguments[1]也不会跟着变
arguments[0]
arguments[1]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
看打印结果可以知道,在非严格模式下,实参
arguments
和形参x
,y
是有映射关系的,改其中一个,另一个会跟着改而在严格模式下,,实参
arguments
和形参x
,y
是没有映射的,所以改了arguments[0]
,x
并不会跟着改;改了y
,arguments[1]
也不会跟着变The text was updated successfully, but these errors were encountered: