You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
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
Copy file name to clipboardExpand all lines: pages/Classes.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -73,12 +73,12 @@ tom.move(34);
73
73
This example covers quite a few of the inheritance features in TypeScript that are common to other languages.
74
74
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.
75
75
76
+
Derived classes that contain constructor functions must call `super()` which will execute the constructor function on the base class.
77
+
76
78
The example also shows how to override methods in the base class with methods that are specialized for the subclass.
77
79
Here both `Snake` and `Horse` create a `move` method that overrides the `move` from `Animal`, giving it functionality specific to each class.
78
80
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`:
79
81
80
-
Derived classes that contain constructor functions must call `super()` which will execute the constructor function on the base class.
0 commit comments