Delegation VS Concatenation in Javascript
问题 Javascript lacks a class construct, however you can still achieve inheritance many different ways. You can mimic classes by utilizing prototypes to create constructor functions and thus implementing inheritance via delegation. The most common way to do this is with the new keyword, but you can also implement object.create() . Alternatively, you can take a concatenative approach and copy behavior that you want your object to inherit directly into the object itself, rather than by pointing its