Skip to content

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

Open

Description

@AMY-Y
入门级
 难度★
请分别写出在浏览器控制台执行以下代码的结果
        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);

Activity

  1. wingmeng commented on May 19, 2019

    @wingmeng
    Collaborator

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions