Skip to content

Commit 47a87a7

Browse files
lex111dblazhkun
andauthored
Update 1-js/08-prototypes/01-prototype-inheritance/article.md
Co-Authored-By: dnzg666 <dnzg666@gmail.com>
1 parent 206aa59 commit 47a87a7

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

  • 1-js/08-prototypes/01-prototype-inheritance

1-js/08-prototypes/01-prototype-inheritance/article.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ alert(animal.isSleeping); // undefined (нет такого свойства в
246246

247247
![](proto-animal-rabbit-walk-3.png)
248248

249-
If we had other objects like `bird`, `snake` etc inheriting from `animal`, they would also gain access to methods of `animal`. But `this` in each method would be the corresponding object, evaluated at the call-time (before dot), not `animal`. So when we write data into `this`, it is stored into these objects.
250249
Если бы у нас были другие объекты, такие как `bird`, `snake` и т.д., унаследованные от `animal`, они также получили бы доступ к методам `animal`. Но `this` в каждом методе будет соответствовать объекту, на котором происходит вызов (до точки), а не `animal`. Поэтому, когда мы записываем данные в `this`, они сохраняются в этих объектах.
251250

252251
В результате методы являются общими, а состояние объекта — нет.

0 commit comments

Comments
 (0)