Skip to content

Commit 32cf594

Browse files
authored
Merge pull request #2027 from lumosmind/patch-48
clarifying example code
2 parents d1ac0c4 + 7d0d654 commit 32cf594

File tree

1 file changed

+3
-0
lines changed
  • 1-js/08-prototypes/01-prototype-inheritance

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ alert(admin.fullName); // John Smith (*)
197197

198198
// setter triggers!
199199
admin.fullName = "Alice Cooper"; // (**)
200+
201+
alert(admin.fullName); // Alice Cooper , state of admin modified
202+
alert(user.fullName); // John Smith , state of user protected
200203
```
201204

202205
Here in the line `(*)` the property `admin.fullName` has a getter in the prototype `user`, so it is called. And in the line `(**)` the property has a setter in the prototype, so it is called.

0 commit comments

Comments
 (0)