Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 9091b49

Browse files
committed
Move sentence in Classes.md
The text did not make sense with the sentence about calling super() between a sentence that leads into an example (with a colon) and the example. This issue was introduced in this commit: d0fa464
1 parent fc93a70 commit 9091b49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/Classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ tom.move(34);
7373
This example covers quite a few of the inheritance features in TypeScript that are common to other languages.
7474
Here we see the `extends` keywords used to create a subclass. You can see this where `Horse` and `Snake` subclass the base class `Animal` and gain access to its features.
7575

76+
Derived classes that contain constructor functions must call `super()` which will execute the constructor function on the base class.
77+
7678
The example also shows how to override methods in the base class with methods that are specialized for the subclass.
7779
Here both `Snake` and `Horse` create a `move` method that overrides the `move` from `Animal`, giving it functionality specific to each class.
7880
Note that even though `tom` is declared as an `Animal`, since its value is a `Horse`, when `tom.move(34)` calls the overriding method in `Horse`:
7981

80-
Derived classes that contain constructor functions must call `super()` which will execute the constructor function on the base class.
81-
8282
```Text
8383
Slithering...
8484
Sammy the Python moved 5m.

0 commit comments

Comments
 (0)