Object Prototypes(OOPS)
Every object in JS has a built in prototype.
It is a single template object that all objects inherit methods and properties from without having an own copy. In an array multiple operations can be performed like push or pop...etc.The array doesnot contain anny info about these functions but it has a prototype that contains all the info.
It inherits info from the prototype and performs those functions
To access a prototype we use
1) arr.__proto__ (REFERENCE - more like a copy)




Comments
Post a Comment