Press "Enter" to skip to content

Javascript原型链和原型的一个误区

之前我对Javascript的原型链中, 原型继承与标识符查找有些迷惑,

如, 如下的代码:

function Foo() {};
var foo = new Foo();
Foo.prototype.label = "laruence";
alert(foo.label); //output: laruence
alert(Foo.label);//output: undefined

Filed in Js/CSS
with 20 Comments