1. Using an object to impersonate the inheritance (this implementation can implement multiple inheritance)
Implementation principle: Make the constructor of the parent class A method of the subclass, then call the method of the subclass, assign the value to all the properties and methods through the This keyword
2. Use call or Apply method to change function context to implement inheritance
Implementation principle: Change the function context inside the function this so that it points to the specific object passed into the function
3, the use of prototype chain to achieve inheritance
Implementation principle: The subclass prototype object points to the parent class to implement inheritance, that is, rewrite the prototype of the class, the disadvantage is not directly implement multiple inheritance
4, the use of hybrid mode to achieve inheritance
JS Implementation inheritance