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 34b51dc

Browse files
committed
minor
1 parent 94a6933 commit 34b51dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,16 @@ alert(typeof User); // function
8787
What `class User {...}` construct really does is:
8888

8989
1. Creates a function named `User`, that becomes the result of the class declaration. The function code is taken from the `constructor` method (assumed empty if we don't write such method).
90-
2. Stores all methods, such as `sayHi`, in `User.prototype`.
90+
2. Stores class methods, such as `sayHi`, in `User.prototype`.
9191

92-
Afterwards, for new objects, when we call a method, it's taken from the prototype, just as described in the chapter <info:function-prototype>. So a `new User` object has access to class methods.
92+
Afterwards, for `new User`objects, when we call a method, it's taken from the prototype, just as described in the chapter <info:function-prototype>. So the object has access to class methods.
9393

9494
We can illustrate the result of `class User` declaration as:
9595

9696
![](class-user.png)
9797

9898
Here's the code to introspect it:
9999

100-
101100
```js run
102101
class User {
103102
constructor(name) { this.name = name; }

0 commit comments

Comments
(0)

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