3 ms·
Mozilla has a nice writeup: https://developer.mozilla.org/nl/docs/Web/JavaScript/Inheritance_and_the_prototype_chain https://developer.mozilla.org/nl/docs/Web/
by amelius 9y ago
Mozilla has a nice writeup:
https://developer.mozilla.org/nl/docs/Web/JavaScript/Inheritance_and_the_prototype_chain https://developer.mozilla.org/nl/docs/Web/JavaScript/Inherit...
But note:
> The lookup time for properties that are high up on the prototype chain can have a negative impact on performance, and this may be significant in code where performance is critical. Additionally, trying to access nonexistent properties will always traverse the full prototype chain.
- chrisseaton 9y ago> The lookup time for properties that are high up on the prototype chain can have a negative impact on performance, and this may be significant in code where performance is critical. Additionally, trying to access nonexistent properties will always traverse the full prototype chain. This makes no sense to me - surely every non-trivial JavaScript implementation has inline caching, and are not doing any kind of lookup at all in performance critical code?