var name = "this is window"
var a = {
name:"this is a",
callname:function(){
alert(this.name)
}
}
function B(){
alert(this.name)//this is B
}
B.prototype.name = "this is B";
B.prototype.callname = function(){
alert(this.name)
}
B.callname = function(){
alert(this.name)
}
//a.callname()
//B.callname()
//(new B()).callname()
最后三个分别得出的是什么值???
相关分类