Skip to content

Commit e3e4502

Browse files
Mistake in naming the property name.
The getter and setter are referring to this._name and the property name that is stored is this.name. Changed it to this._name.
1 parent 8f13d61 commit e3e4502

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/09-classes/02-class/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class User {
163163

164164
constructor(name) {
165165
// invokes the setter
166-
this.name = name;
166+
this._name = name;
167167
}
168168

169169
*!*

0 commit comments

Comments
 (0)