0
Hello guys, tell me what is difference between _proto_ and [[PROTOTYPE]], don't confuse with .prototype
Let b = {} b._proto_ === Object.prototype b.[[PROTOTYPE]] === Object.prototype Is it the same?
9 Respostas
+ 3
yes; __proto__ (double dunder as prefix and postfix) is same as [[prototype]]
they are internal property of object..
the former is deprecated (in favor of getPrototypeOf() method), even if still often supported for ascending compatibility ;)
the later is a notation used in books/documentations and has no use in code
https://developer.mozilla.org/en-US/docs/Web/JavaScript/The_performance_hazards_of_prototype_mutation
+ 1
Object.getPrototypeOf(b) -> Object.prototype
+ 1
Тимур Завьялов look at this schema, hopefully it will help you to understand
https://code.sololearn.com/W79SrO1dgHFr/?ref=app
+ 1
Artur, basically, I got it
+ 1
Тимур Завьялов I wrote down js code in there. May be it will help you as well. Good luck 🤗
0
visph, and what will it look like with getPrototypeOf?
0
visph, thanks)
0
Artur, thanks)