I've always seen examples of Class.prototype.method, but never instances of this.prototype.method. For example:
function Class() {
this.prototype.method = function() {
alert("is this allowed?");
};
}
vs
function Class() {}
Class.prototype.method = function() {
alert("traditional example");
};
- Does this.prototype exist?
- Is it the same as Class.prototype?
- What about inheritance?