Jul 7, 2024
arr
containing "Akshay" and "Aditya" accessing .push()
method..__proto__
arr.__proto__
provides access to array methods like .forEach
, .includes
.arr.__proto__
(Array prototype) -> Array.prototype.__proto__
(Object prototype) -> null.object.__proto__
(Object prototype) -> Object.prototype.__proto__
-> nullnull
.object
and object2
.object2
inherits properties (city
, getIntro()
) from object
through prototype chain..__proto__
due to performance issues.mybind
to Function.prototype
allowing all functions to inherit mybind
.mybind()
method to every function..__proto__
: Prevent accidental modification of prototypes; underscores make it less likely to be used mistakenly.