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 9909b90

Browse files
committed
minor
1 parent 072fa7d commit 9909b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎1-js/09-classes/02-class-inheritance/article.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ The short answer is: constructors in inheriting classes must call `super(...)`,
236236

237237
Of course, there's an explanation. Let's get into details, so you'll really understand what's going on.
238238

239-
In JavaScript, there's a distinction between a "derived constructor" (constructor function of an inheriting class) and other functions. A derived constructor has a special internal property `[[ConstructorKind]]:"derived"`. In other words, the constructor function of a class that "extends" something bears a "special label".
239+
In JavaScript, there's a distinction between a constructorfunction of an inheriting class (so-called "derived constructor") and other functions. A derived constructor has a special internal property `[[ConstructorKind]]:"derived"`. That's a special internal label.
240240

241241
That label affects its behavior with `new`.
242242

243-
- When a regular function `F`is executed as `new F`, it creates an empty object and assigns it to `this`.
243+
- When a regular function is executed with `new`, it creates an empty object and assigns it to `this`.
244244
- But when a derived constructor runs, it doesn't do this. It expects the parent constructor to do this job.
245245

246246
So a derived constructor must call `super` in order to execute its parent (non-derived) constructor, otherwise the object for `this` won't be created. And we'll get an error.

0 commit comments

Comments
(0)

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