This commit is contained in:
zhangbao 2020-01-20 15:34:31 +08:00 committed by GitHub
parent db3b3f8e7a
commit 3a071c9279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -264,7 +264,7 @@ class User {
let user = new User("John");
alert(user.name); // John
user = new User(""); // Name too short.
user = new User(""); // Name is too short.
```
The class declaration creates getters and setters in `User.prototype`, like this: