fixes
This commit is contained in:
parent
33642d3643
commit
3cc9734143
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ Internally, `extends` keyword works using the good old prototype mechanics. It s
|
||||||
For instance, to find a method for `rabbit.hide()`, the engine checks:
|
For instance, to find a method for `rabbit.hide()`, the engine checks:
|
||||||
1. The `rabbit` object (no `hide`).
|
1. The `rabbit` object (no `hide`).
|
||||||
2. Its prototype, that is `Rabbit.prototype` (also no `hide`).
|
2. Its prototype, that is `Rabbit.prototype` (also no `hide`).
|
||||||
3. Its prototype, that is (due to `extends`) `Animal.prototype`, that has the method.
|
3. Its prototype, that is (due to `extends`) `Animal.prototype`, that finally has the method.
|
||||||
|
|
||||||
As we can recall from the chapter <info:native-prototypes>, JavaScript uses prototypal inheritance for build-in objects. E.g. `Date.prototype.[[Prototype]]` is `Object.prototype`, so dates have generic object methods.
|
As we can recall from the chapter <info:native-prototypes>, JavaScript uses prototypal inheritance for build-in objects. E.g. `Date.prototype.[[Prototype]]` is `Object.prototype`, so dates have generic object methods.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue