Took an example if
var Func = function(){}
Here Func has a property called a prototype, and I can add my own methods as follows.
Func.prototype.move = function(){
In accordance with my understanding, the prototype here is another Func property, which is provided by the interpreter by default and is not used to delegate any functionality, i.e. there is nothing like it
Func.move()
Using the same logic, I create another property of the same function as the following
Func.method = function(){
Now, if you create a new object
var obj = new Func();
There is obj.move() , but obj.method() will not be there. If a prototype is another property without magical benefits, then why is it a certain behavior? Thanks in advance!
source share