From 773cc06a3b269c15ba29cf21a4911661a0ac303f Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 11 Oct 2019 10:45:13 +0300 Subject: [PATCH] fixes --- 1-js/09-classes/02-class-inheritance/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/09-classes/02-class-inheritance/article.md b/1-js/09-classes/02-class-inheritance/article.md index 02ead660..7ea77d8d 100644 --- a/1-js/09-classes/02-class-inheritance/article.md +++ b/1-js/09-classes/02-class-inheritance/article.md @@ -61,9 +61,9 @@ Internally, `extends` keyword works using the good old prototype mechanics. It s ![](animal-rabbit-extends.svg) -For instance, to find a method for `rabbit.hide()`, the engine checks: -1. The `rabbit` object (no `hide`). -2. Its prototype, that is `Rabbit.prototype` (also no `hide`). +For instance, to find `rabbit.run` method, the engine checks: +1. The `rabbit` object (has no `run`, only `name`). +2. Its prototype, that is `Rabbit.prototype` (has `hide`, but not `run`). 3. Its prototype, that is (due to `extends`) `Animal.prototype`, that finally has the method. As we can recall from the chapter , JavaScript uses prototypal inheritance for build-in objects. E.g. `Date.prototype.[[Prototype]]` is `Object.prototype`, so dates have generic object methods.