In JavaScript, if I create a constructor function Foo, a prototype object will also be created as Foo.prototype. So I tried this:
function Foo() { this.xx = 1000}
I thought the created prototype object Foo.prototype will have the property xx = 1000. So I tried this:
console.log(Foo.prototype.xx);
But the result is "undefined". Why is this?
Shouldn't there be a Foo.prototype object with single property xx to be 1000?
Thanks.