之前我对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 23 Comments
左手代码右手诗
之前我对Javascript的原型链中, 原型继承与标识符查找有些迷惑,
如, 如下的代码:
function Foo() {}; var foo = new Foo(); Foo.prototype.label = "laruence"; alert(foo.label); //output: laruence alert(Foo.label);//output: undefined