+ 2
What is object prototype in Javascript ?
2 ответов
+ 3
A good explanation
https://medium.com/better-programming/prototypes-in-javascript-5bba2990e04b
+ 2
Prototypes are the mechanism by which JavaScript objects inherit features from one another. In this ,I am explaining how prototype chains work and look at how the prototype property can be used to add methods to existing constructors.All JavaScript objects inherit properties and methods from a prototype:
Date objects inherit from Date.prototype;Array objects inherit from
Array.prototype;Person objects inherit from Person.prototype
The Object.prototype is on the top of the prototype inheritance chain:Date objects, Array objects, and Person objects inherit from Object.prototype.