That's a getter/setter for it -> It's a getter/setter for it

This commit is contained in:
Peter Roche 2020-04-22 17:34:59 -06:00 committed by GitHub
parent 37107f74ae
commit d65141d44b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ rabbit.__proto__ = animal;
```
```smart header="`__proto__` is a historical getter/setter for `[[Prototype]]`"
Please note that `__proto__` is *not the same* as `[[Prototype]]`. That's a getter/setter for it.
Please note that `__proto__` is *not the same* as `[[Prototype]]`. It's a getter/setter for it.
It exists for historical reasons. In modern language it is replaced with functions `Object.getPrototypeOf/Object.setPrototypeOf` that also get/set the prototype. We'll study the reasons for that and these functions later.