Today I Learned

JavaScript prototype

October 15, 2023

All JavaScript objects have a __proto__ property, which is a reference to another object, which is called the object’s “prototype”. When a property is accessed on an object and if the property is not found on that object, the JavaScript engine looks at the object’s __proto__, and the __proto__’s __proto__ and so on, until it finds the property defined on one of the __proto__s or until it reaches the end of the prototype chain.

js proto


© 2025 - Written by Vuong Vu. Connect with me on LinkedIn.