I've been trying to find an answer, and can't seem to find one directly related to this. So I have a Constructor called Person, and to it I assign a prototype method "getFull". My question is, why can't I statically call the "getFull" method (given that getFull does not access "this") with Person.getFull();?
I've done some research on prototypes, and I know that for static methods generally you don't add them to the prototype of the constructor, but instead just add them directly to the constructor (so instead of Person.prototype.getFull, you would normally add Person.getFull), but I'm wondering why this function call won't work. I thought that for any given object property, we first check to see if the object directly contains that property, and if not we recursively check the object's prototype to see if the prototype has the property. Therefore, I assumed that because Person.getFull does not exist, it would default to Person.prototype.getFull.
function Person(name, family) {
this.name = name;
this.family = family;
}
Person.prototype.getFull = function() {
console.log('bla')
};
This is a purely theoretical question, new to javascript (coming from a Java background).