Prototype allow to declare method for objects that will be shared between each instance of the objects
Lets take this code
var myObj = function() {};
myObj.prototype.test = function() {
alert('test');
};
You will call it with
var instance = new myObj();
instance.test();
So test() is now a method of myObj
But since you declared it with prototype, even if you create 100 myObj, the test function will simply be 1 time in memory.
So if we didn't use prototype like so
var myObj = function() {};
myObj.test = function() {
alert('test');
};
And create 100 new myObj, in memory you will have 100 time the test function
So most of the time (99% of the time) you will want to declare your method as prototype