Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update article.md #3814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 1-js/09-classes/02-class-inheritance/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,10 @@ rabbit.eat(); // Error calling super (because there's no [[HomeObject]])
- We must call parent constructor as `super()` in `Child` constructor before using `this`.
3. When overriding another method:
- We can use `super.method()` in a `Child` method to call `Parent` method.
4. Internals:
4. When overriding class fields, the class field is initialized:
- Before constructor for the base class (that doesn’t extend anything).
- Immediately after super() for the derived class.
5. Internals:
- Methods remember their class/object in the internal `[[HomeObject]]` property. That's how `super` resolves parent methods.
- So it's not safe to copy a method with `super` from one object to another.

Expand Down