JavaScript Quiz系列题集05

var x = 3;
    var foo = {
        x: 2,
        baz: {
            x: 1,
            bar: function() {
                return this.x;
            }
        }
    }
    var go = foo.baz.bar;
    console.log(go());//3 至关于window.go();
    console.log(foo.baz.bar());//1 this老是指向调用对象的
相关文章
相关标签/搜索