Converts Object.create (proto) proto (indicated by Chrome output)?

The following script puzzles me a bit:

function A() { } var a = new A(); console.log(a); //A {} Object.create(a); console.log(a); //Object {} 

Fiddle

Thus, it is obvious that Object.create() somehow modifies the object that is passed to it. However, I do not see any difference.

So what's going on? Why is the output of console.log() different in both cases?

Note. I noticed this only in Chrome. In Firefox, the output seems to always be Object {} . Not sure about other browsers.

+1
source share

All Articles