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
// considered bad practice
let admin = {
__proto__: userProxy,
_name: "Admin"
};
// recommended
let admin = Object.create(userProxy);
admin._name = 'Admin'
The text was updated successfully, but these errors were encountered:
en.javascript.info/1-js/99-js-misc/01-proxy/article.md
Line 712 in 285083f
As per MDN and ECMASCRIPT, use of this approach seems to be deemed legacy and will at some point be withdrawn from browsers.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.prototype.__proto__
The alternative seems to be
Object.create
?The text was updated successfully, but these errors were encountered: