クラスの継承 (inheritance)
JavaScriptのクラスも他のクラスを持つ言語と同じように、extendsキーワードで継承ができます。
jsclassParent {}classChild extendsParent {}
jsclassParent {}classChild extendsParent {}
サブクラスにコンストラクタを書く場合、スーパークラスのコンストラクタは必ず呼び出す必要があります。スーパークラスのコンストラクタはsuper()で呼び出します。
jsclassParent {}classChild extendsParent {constructor() {super();}}
jsclassParent {}classChild extendsParent {constructor() {super();}}