根据作用域链的原理,最后this.name不应该在object里面找吗?
var name = "The Window";    var object = {
        name : "My Object",
        getNameFunc : function(){
            alert("My Object "+this.name); //MyObject
            return function () {
                alert("The Window "+this.name);                return this.name;//This Window
            }
        }
    }; 临摹微笑
临摹微笑 随时随地看视频慕课网APP
随时随地看视频慕课网APP
相关分类