Difference between __proto__ and Prototype in JavaScript | Well explained | Astute Js

Опубликовано: 12 Октябрь 2024
на канале: Astute JS
9,354
64

https://jsfiddle.net/sathishkrcs/67q6...

prototype is a property of a Function object. It is the prototype of objects constructed by that function.

_proto_ is internal property of an object, pointing to its prototype. Current standards provide an equivalent Object.getPrototypeOf(O) method, though de facto standard _proto_ is quicker.

You can find instanceof relationships by comparing a function's prototype to an object's _proto_ chain, and you can break these relationships by changing prototype.

https://stackoverflow.com/questions/9...