js笔试题
var name = "The Window"; function aaa(){ this.name = "My Object"; this.getNameFunc = function(){ return name; } } function bbb(){ this.name = "My Object"; this.getNameFunc = function(){ return this.name; } } function ccc(){ this.name = "My Object"; this.getNameFunc = function(){ return function(){ return this.name; }; } } function ddd(){ this.name = "My Object"; this.getNameFunc = function(){ return function(){ return name; }; } } var object = { name : "My Object", getNameFunc : function(){ return function(){ return this.name; }; } var a = new aaa(); var b = new bbb(); var c = new ccc(); var d = new ddd(); a.getNameFunc(); b.getNameFunc(); c.getNameFunc()(); d.getNameFunc()(); object.getNameFunc()()
求输出~
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。