You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/08-prototypes/01-prototype-inheritance/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,8 +198,8 @@ alert(admin.fullName); // John Smith (*)
198
198
// setter triggers!
199
199
admin.fullName="Alice Cooper"; // (**)
200
200
201
-
alert(admin.fullName); // Alice Cooper, state of admin modified
202
-
alert(user.fullName); // John Smith, state of user protected
201
+
alert(admin.fullName); // Alice Cooper, state of admin modified
202
+
alert(user.fullName); // John Smith, state of user protected
203
203
```
204
204
205
205
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