Ad
  • Default User Avatar

    prototype allows you to attach a property or a function that can be accessible to all instantiations of the particular class, for example you can add your own properties so that when you do Object.prototype.newFunction = function(){some code here}. Now.. any new objects that you instantiate would be able to access your new function so that var x = new Object then x.newFunction(), would now work.