What is Prototypes in javascript?

Is there someone who can explain or define prototypes in javascript?

Let us understand the requirement of using prototype first. 

Suppose you have a person class and there are two properties inside it. 

You have created multiple objects and now you want to add a new property into class and that should 

be available in all created objects then you would require to use prototype. If you add the new property in your class prototype, 

it will be available in all objects.

Every javascript object inherit properties and methods from a prototype and 

Object prototype is on top of the hierarchy. Suppose you have a class College below:

College = function(name, address) {

    this.collegeName = name;

    this.collegeAddress = address;

}

var obj = new College('SI College', 'New Delhi');

To add a new property which should be available in all objects:

College.prototype.courseName = "English";

Now you can access this 'courseName' property using obj object like obj.courseName .