javascript-tutorial / javascript-tutorial/en.javascript.info
__proto__ deprecation
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
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'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open 1-js/99-js-misc/01-proxy/article.md around line 712 and compare the example with the linked MDN and ECMAScript references. Update the documented approach if the legacy proto usage should be replaced, then check the surrounding tutorial text for consistency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100