commit
4be5963be4
1 changed files with 1 additions and 1 deletions
|
@ -211,7 +211,7 @@ The answer is simple: `this` is not affected by prototypes at all.
|
||||||
|
|
||||||
So, the setter call `admin.fullName=` uses `admin` as `this`, not `user`.
|
So, the setter call `admin.fullName=` uses `admin` as `this`, not `user`.
|
||||||
|
|
||||||
That is actually a super-important thing, because we may have a big object with many methods and inherit from it. Then inherited objects can run its methods, and they will modify the state of these objects, not the big one.
|
That is actually a super-important thing, because we may have a big object with many methods, and have objects that inherit from it. And when the inheriting objects run the inherited methods, they will modify only their own states, not the state of the big object.
|
||||||
|
|
||||||
For instance, here `animal` represents a "method storage", and `rabbit` makes use of it.
|
For instance, here `animal` represents a "method storage", and `rabbit` makes use of it.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue