You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's important to note that while Object.prototype.__proto__ is deprecated and non-standard, the __proto__ in literal initializers is standard and probably not any less efficient than Object.create [citation needed]. It's important for MDN to highlight the difference between the two.
The __proto__ property can also be used in an object literal definition to set the object [[Prototype]] on creation.
Which can be confusing as well, because __proto__ in object literals is a special construct, not relevant to Object.prototype.__proto__.
I'm open to contributing the two fixes myself, mostly just want to see if anyone has sources on whether __proto__ in initializers are less/more efficient than Object.create.
I'm open to contributing the two fixes myself, mostly just want to see if anyone has sources on whether __proto__ in initializers are less/more efficient than Object.create.
Thanks — I’ve assigned this to you, so please do go ahead and open a PR
What is the new suggestion?
This pattern should be mentioned:
In addition to the
Object.create
method.Why is it important or useful?
It's important to note that while
Object.prototype.__proto__
is deprecated and non-standard, the__proto__
in literal initializers is standard and probably not any less efficient thanObject.create
[citation needed]. It's important for MDN to highlight the difference between the two.Slightly off-topic: the
Object.prototype.__proto__
documentation mentioned that:Which can be confusing as well, because
__proto__
in object literals is a special construct, not relevant toObject.prototype.__proto__
.I'm open to contributing the two fixes myself, mostly just want to see if anyone has sources on whether
__proto__
in initializers are less/more efficient thanObject.create
.Other supporting information
The text was updated successfully, but these errors were encountered: