A simple text to let you know about inheritance

1. What is inherited

1, associated with inheritance constructor application
2, means, so that a constructor to inherit properties and methods of another constructor
3, occurs between two succession constructor



Here Insert Picture Description between two constructors 1

2 children inherit the parent

3 is the parent inherited properties and methods


A common method of inheritance 2 ES5

1, the prototype inheritance

Prototypal inheritance 1
Here Insert Picture Description

2 prototypal inheritance
Here Insert Picture Description

2, to borrow the constructor inheritance
Here Insert Picture Description

With the constructor inheritance - multiple inheritance
Here Insert Picture Description
Here Insert Picture Description

3, the combination of inheritance
Here Insert Picture Description
ES6 class inheritance syntax

ES6 syntax, provides a very simple inheritance
Here Insert Picture Description

Published 21 original articles · won praise 63 · views 7746

Guess you like

Origin blog.csdn.net/ephemeral0/article/details/104905631