This commit is contained in:
Ilya Kantor 2017-04-17 21:42:33 +02:00
parent 8fc01fa0fe
commit a4a16fccd6
8 changed files with 105 additions and 26 deletions

View file

@ -161,7 +161,7 @@ let user = {
let admin = user;
user = null; // overwrite to make things obvious
admin.sayHi(); // Woops! inside sayHi(), the old name is used! error!
admin.sayHi(); // Whoops! inside sayHi(), the old name is used! error!
```
If we used `this.name` instead of `user.name` inside the `alert`, then the code would work.