Skip to content

Commit 773cc06

Browse files
committed
fixes
1 parent 3cc9734 commit 773cc06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/09-classes/02-class-inheritance/article.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Internally, `extends` keyword works using the good old prototype mechanics. It s
6161

6262
![](animal-rabbit-extends.svg)
6363

64-
For instance, to find a method for `rabbit.hide()`, the engine checks:
65-
1. The `rabbit` object (no `hide`).
66-
2. Its prototype, that is `Rabbit.prototype` (also no `hide`).
64+
For instance, to find `rabbit.run` method, the engine checks:
65+
1. The `rabbit` object (has no `run`, only `name`).
66+
2. Its prototype, that is `Rabbit.prototype` (has `hide`, but not `run`).
6767
3. Its prototype, that is (due to `extends`) `Animal.prototype`, that finally has the method.
6868

6969
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.

0 commit comments

Comments
 (0)