function ABC(){ ... }
ABC.prototype.newMethod = function(){} //to create a new method
Then how about ABC.prototype = function() { ... } ?
Can I know what is the difference?
This is correct:
This is incorrect:
ABC.prototype = function() { ... }
What you may be looking for is:
ABC.prototype = { newMethod: function() {}, anotherMethod: function() {} };