Skip to content

Update article.md #596

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

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions 1-js/08-prototypes/04-prototype-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ let clone = Object.create(
- Ще пізніше, в 2015 році, методи `Object.setPrototypeOf` та `Object.getPrototypeOf` були додані до стандарту, для того, щоб виконувати аналогічну функціональність як і `__proto__`. Оскільки `__proto__` було широко реалізовано, воно згадується в Annex B стандарту як не обов’язкове для не-браузерних середовищ, але вважається свого роду застарілим.
- Пізніше, у 2022 році, було офіційно дозволено використовувати `__proto__` в об'єктних літералах `{...}` (винесено з Annex B), але не як геттер/сеттер `obj.__proto__` (ця можливість все ще в Annex B).

Чому `__proto__` було замінено функціями `getPrototypeOf/setPrototypeOf`?

Таким чином зараз ми маємо всі ці способи для роботи з прототипом.

Чому `__proto__` було замінено методами `getPrototypeOf/setPrototypeOf`? Це цікаве питання, яке вимагає від нас розуміння чому `__proto__` має недоліки. Прочитайте далі, щоб дізнатися відповідь.
Чому `__proto__` було замінено методами `getPrototypeOf/setPrototypeOf`?

Чому `__proto__` було частково відновлено і його використання дозволено в `{...}`, але не як геттер/сеттер?

Expand Down