Reputation: 42176
In Chrome when i'm doing this:
var A = function(){};
A.prototype = { a:1,b:2 };
var aInst = new A;
aInst.a = 11;
console.log(aInst);
I see this in console:
I didn't see Object
s with two properties with the same name ("a
") before, something wrong with my Chrome?
Here: http://jsfiddle.net/4Zws3/1/
Upvotes: 4
Views: 214
Reputation: 16571
One a
is an instance property, the other is a value of the prototype object.
I'm actually seeing this in Chrome:
Upvotes: 2