面试准备(4) 作用域 预解析 字面量 arguments 等考察点练习

第一题


解析

 // 解释  100  2
    var length = 100;
    function f1(){
        console.log(this.length) //this会变  数组长度属性length
    }
    var obj = {
        x:10,
        f2:function(f1){
            f1(); //无调用者 就是全局 window  =>100
            arguments[0]()//arguments[0]=f1 无调用者 作用域是arguments对象, =》2
        }
    }
    obj.f2(f1,1)

第二题


答案** hello**

第三题

第四题

第五题

第六题

第七题

原文地址:https://www.cnblogs.com/loveliang/p/13879202.html