javascript-tutorial / javascript-tutorial/en.javascript.info

__proto__ deprecation

Open
#3,601 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
25.5k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/javascript-tutorial/en.javascript.info/blob/285083fc71ee3a7cf55fd8acac9c91ac6f62105c/1-js/99-js-misc/01-proxy/article.md?plain=1#L712

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.