- JavaScript is a prototype-based language. Every object in JavaScript has a built-in property prototype.
Prototype
is used to inherit properties and methods from one object to another.- When a property or method is accessed on an object, it first checks if that property or method exists on the object or object's prototype and its prototype and so on, until it reaches the end of the prototype chain which is null.
- prototype is a class that current object can take methods of.
There are different ways prototype are used in javascript.