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.
This commit is contained in:
parent
8f13d61a8b
commit
e3e4502ce2
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ class User {
|
|||
|
||||
constructor(name) {
|
||||
// invokes the setter
|
||||
this.name = name;
|
||||
this._name = name;
|
||||
}
|
||||
|
||||
*!*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue