The following script puzzles me a bit:
function A() { } var a = new A(); console.log(a);
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.
source share