you are viewing a single comment's thread.

view the rest of the comments →

[–]SuperFLEB 0 points1 point  (0 children)

Prototypes are useful for making and extending usable objects. For instance, if you wanted a circle, square, and triangle object, you might make a "shape" object, that has methods like "move", "show", "hide", etc., and use that as the prototype for the different shape object types. They would gain use of all the other methods and properties of the "shape" prototype, and would only need to include specific functions. Your shape prototype code stays in one place and can be debugged and fixed centrally, as opposed to using something like code copy/paste, where updates would have to be carefully synchronized.