class является образцом java Script Object. Конструкция «class» позволяет определять классы на основе прототипов с чистым, красивым синтаксисом.

// define class Human
class Human {
  constructor(){
    this.age = 19;
  }
  printAge(){
    console.log(this.age);
  }
}
// define class person and extends class human
class Person extends Human{
  constructor(){
    super(); // calling class Human for initialise age
    this.name = 'Pritam';
    this.age = 20;  
}
  printPerson(){
    console.log(this.name);
  }
}
let person = new Person(); // constructor 
person.printPerson();
person.printAge(); 
//output
"Pritam"
 20