JavaScript prototype Tutorial Add Object Method and Property to Class
Lesson Code: http://www.developphp.com/video/JavaScript/prototype-Tutorial-Add-Object-Methods-and-Properties-to-Class
The JavaScript prototype property allows us to add specialized methods and properties to our custom objects and classes. There may be occasions when you must specialize the functionality of an object in your application, and the prototype property allows us to do that. It also enables Object Inheritance in JavaScript, which we will be demonstrating in the video that follows this one. Before we discuss Object Inheritance let’s write some code that demonstrates how the prototype property works at a basic level in JavaScript.
source