images to svg
This commit is contained in:
parent
a31e881856
commit
3ba28aa104
734 changed files with 11682 additions and 245 deletions
|
@ -24,7 +24,7 @@ class Animal {
|
|||
let animal = new Animal("My animal");
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
...And `Rabbit`:
|
||||
|
@ -42,7 +42,7 @@ class Rabbit {
|
|||
let rabbit = new Rabbit("My rabbit");
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
Right now they are fully independent.
|
||||
|
@ -88,7 +88,7 @@ Now the `Rabbit` code became a bit shorter, as it uses `Animal` constructor by d
|
|||
|
||||
Internally, `extends` keyword adds `[[Prototype]]` reference from `Rabbit.prototype` to `Animal.prototype`:
|
||||
|
||||

|
||||

|
||||
|
||||
So, if a method is not found in `Rabbit.prototype`, JavaScript takes it from `Animal.prototype`.
|
||||
|
||||
|
@ -384,7 +384,7 @@ So, in both lines `(*)` and `(**)` the value of `this.__proto__` is exactly the
|
|||
|
||||
Here's the picture of what happens:
|
||||
|
||||

|
||||

|
||||
|
||||
1. Inside `longEar.eat()`, the line `(**)` calls `rabbit.eat` providing it with `this=longEar`.
|
||||
```js
|
||||
|
@ -501,7 +501,7 @@ The reason is simple:
|
|||
- So its `[[HomeObject]]` is `rabbit`, as it was created in `rabbit`. There's no way to change `[[HomeObject]]`.
|
||||
- The code of `tree.sayHi()` has `super.sayHi()` inside. It goes up from `rabbit` and takes the method from `animal`.
|
||||
|
||||

|
||||

|
||||
|
||||
### Methods, not function properties
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue