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 c82abef

Browse files
committed
minor
1 parent 0e97922 commit c82abef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The notation here is not to be confused with object literals. Within the class,
6464

6565
## What is a class?
6666

67-
So, what exactly is a `class`? That's not an entirely new language-level entity, as one might think.
67+
So, what exactly is a `class`? That's not an entirely new language-level entity, as one might think.
6868

6969
Let's unveil any magic and see what a class really is. That'll help in understanding many complex aspects.
7070

@@ -91,7 +91,7 @@ What `class User {...}` construct really does is:
9191

9292
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 `new User` object has access to class methods.
9393

94-
We can illustrate the result of `class User` as:
94+
We can illustrate the result of `class User` declaration as:
9595

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

@@ -198,7 +198,8 @@ Similar to Named Function Expressions, class expressions may or may not have a n
198198
If a class expression has a name, it's visible inside the class only:
199199
200200
```js run
201-
// "Named Class Expression" (alas, no such term, but that's what's going on)
201+
// "Named Class Expression"
202+
// (no such term in the spec, but that's similar to Named Function Expression)
202203
let User = class *!*MyClass*/!* {
203204
sayHi() {
204205
alert(MyClass); // MyClass is visible only inside the class
@@ -268,7 +269,7 @@ alert(user.name); // John
268269
user = new User(""); // Name too short.
269270
```
270271

271-
Internally, getters and setters are created on `User.prototype`, like this:
272+
The class declaration creates getters and setters in `User.prototype`, like this:
272273

273274
```js
274275
Object.defineProperties(User.prototype, {

0 commit comments

Comments
(0)

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