4

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:

enter image description here

I didn't see Objects with two properties with the same name ("a") before, something wrong with my Chrome?

Here: http://jsfiddle.net/4Zws3/1/

shesek
  • 4,584
  • 1
  • 28
  • 27
Ivan Chernykh
  • 41,617
  • 13
  • 134
  • 146

1 Answers1

2

One a is an instance property, the other is a value of the prototype object.

I'm actually seeing this in Chrome:

enter image description here

Matt Zeunert
  • 16,075
  • 6
  • 52
  • 78