Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__proto__ deprecation #3601

Open
bevand10 opened this issue Oct 27, 2023 · 0 comments · May be fixed by #3623
Open

__proto__ deprecation #3601

bevand10 opened this issue Oct 27, 2023 · 0 comments · May be fixed by #3623

Comments

@bevand10
Copy link

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 ?

// considered bad practice
let admin = {
  __proto__: userProxy,
  _name: "Admin"
};

// recommended
let admin = Object.create(userProxy);
admin._name = 'Admin'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant