Class Inheritance: instances
inherit from classes (like a blueprint — a description of the class),
and create sub-class relationships: hierarchical class taxonomies.
Instances are typically instantiated via constructor functions with the `new` keyword. Class inheritance may or may not use the `class` keyword from ES6.
Prototypal Inheritance: instances inherit directly from other objects. Instances are typically instantiated via factory functions or `Object.create()`. Instances may be composed from many different objects, allowing for easy selective inheritance.
Comments
Post a Comment