标签:this foo his function asc new highlight 优先级 nbsp
function Foo(){
getName = function(){alert(1)}
return this;
}
Foo.getName = function(){alert(2)}
Foo.prototype.getName = function(){alert(3)}
var getName = function(){alert(4)}
function getName(){alert(5)}
Foo.getName(); // 2
getName(); //4
Foo().getName(); //1
getName(); //1
new Foo.getName(); //2
new Foo().getName(); // 3
new new Foo().getName(); // 3
标签:this foo his function asc new highlight 优先级 nbsp
原文地址:https://www.cnblogs.com/daji/p/9599413.html