1. ES5 inheritance essentially creates the instance object of the subclass and then adds the methods of the Parent class to this (parent.apply (this)).
ES6 inherits completely differently, essentially creating an instance of this(so you must call the super() method of the superclass first) and then modifying this with the constructor of the subclass.
3. Inheritance in ES5 is implemented through the prototype or constructor mechanism.
ES6 defines classes using the class keyword, which contains constructors. Classes inherit from each other using the extends keyword.
Subclasses must call super from the constructor method, otherwise new instances will fail. Because subclasses don’t have their own This object, they inherit this from their parent class and then process it. If you don’t call super, subclasses don’t get this.
Note: the super keyword refers to an instance of the superclass, which is the this object of the superclass. Note: In the subclass constructor, the this keyword can only be used after super is called, otherwise an error is reported
Some things to note about class:
1. Class declares that strict mode is enabled internally.
2. All methods of class, including static and instance methods, are not enumerable.
All class methods (static and instance methods) have no prototype object, so [[construct]] is not called with new.
4. Class must be called using new.
The class name cannot be overridden inside the class.