It should be a prototype of the constructor function, not the object this function produces:
a.prototype.three = 3;
You can't access object's prototype with the prototype
key, because prototype reference is not exposed like this. You could do it using __proto__
property though, but this is deprecated. If you need to get a prototype of the object you can make use of Object.getPrototypeOf
method:
Object.getPrototypeOf(j) === a.prototype; // true
It's a little confusing here because the word "prototype" sort of means two things. Function prototype is an object that is used when new object is constructed when the function is used like a constructor. Object prototype is a reference to the object which stores inherited methods.