javascript中的作用域

        var foo = {
            baz: 1,
            bar: function () {
                return this.baz;
            }
        };
        console.log(foo.bar());  //1
        (function () {
            this; //Window
            console.log(arguments[0]()); //undefined
        })(foo.bar)





备注:欢迎加入web前端求职招聘qq群:668352707

原文地址:https://www.cnblogs.com/xutongbao/p/9924875.html