From javascript console in Chrome:
> function Person(name){this.name=name;}
undefined
At this point, Person.prototype should be an empty object according to Javascript specifications. Let appoint him:
> p=Person.prototype
> Person
Please note that this> Person is clickable, and it expands to:
constructor: function Person(name){this.name=name;}
__proto__: Object
But ... doesn't that mean it's an empty object? What is this additional material? If you make a warning:
alert(p)
You get [Object Object]. Why, when you enter it into the Chrome console, does it go out s> Face that expands? Doesn't that mean it's an empty object?
Thank!
source
share