经典前端面试题,难倒不少人,哪位大神帮我解释下后面call的答案啊

var name = "The Window";

var object = {

    name : "My Object",

    getNameFunc : function(){

        alert('1.' + this.name);

        return function(){

            return this.name;

        };

    }

};


var func = object.getNameFunc();

alert('2.' + func());

 alert('3.' + func.call(object));

alert('4.' + func.apply(object));


慕娘9325324
浏览 1032回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP