When creating a new Class you can inherit and use the properties and methods from the parent Class with calling super(); in your constructor();
Class Human(){ constructor(){ this.race = "Human"; } printRace(){console.log(this.race)} } Class Person extends Human { constructor(){ this.name = "Jasmin"; super(); // <= this executes the initializaton of the parent methods and properties } printName(){ console.log(this.name) } me = new Person(); me.printName() // "Jasmin"…React Cheat Sheet
Inheriting Methods & Properties