Skip to content
New issue

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

第 11 期(2019-05-18):arguments与'use strict' #13

Open
AMY-Y opened this issue May 18, 2019 · 1 comment
Open

第 11 期(2019-05-18):arguments与'use strict' #13

AMY-Y opened this issue May 18, 2019 · 1 comment

Comments

@AMY-Y
Copy link

AMY-Y commented May 18, 2019

入门级
 难度★
请分别写出在浏览器控制台执行以下代码的结果
        function b(x,y,a){
            arguments[2]=10;
            console.log(a);
        };
        b(1,2,3);
        function b(x,y,a){
            'use strict'
            arguments[2]=10;
            console.log(a);
        };
        b(1,2,3);
@wingmeng
Copy link
Collaborator

第一个输出:10
第二个输出:3

严格模式下 arguments 不会追踪参数的变化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants