Definition and Usage
The prototype property allows you to add properties and methods to an object.
In this example we will show how to use the prototype property to add a property to an object:
this.name = name;
this.jobtitle = jobtitle;
this.born = born;
employee.prototype.salary = 2000;
var fred = new employee("Fred Flintstone", "Caveman", 1970);
You are not advised to change the prototype of an object that you do not control.
Only change the prototype of your own objects.
The prototype Property
prototype property allows you to add new properties to objects:
this.firstName = first;
this.lastName = last;
this.eyeColor = eyecolor;
Person.prototype.nationality = "English";
❮ Complete Math Object Reference