Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7c691b4

Browse files
authored
Merge pull request #1585 from lumosmind/patch-31
not proved features of class properties
2 parents c78cfdf + 4df1cb9 commit 7c691b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎1-js/09-classes/01-class/article.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ class User {
318318
}
319319

320320
new User().sayHi();
321+
322+
alert(User.prototype.sayHi); // placed in User.prototype
323+
alert(User.prototype.name); // undefined, not placed in User.prototype
321324
```
322325

323326
The property `name` is not placed into `User.prototype`. Instead, it is created by `new` before calling the constructor, it's a property of the object itself.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /