Summary
In this chapter, we focused on understanding ES6 classes. ES6 classes give formal support to the common JavaScript pattern of simulating class-like inheritance hierarchies using functions and prototypes. They are syntactic sugaring over prototype-based OO, offering a convenient declarative form for class patterns which encourage interoperability. ES6 classes offer a much nicer, cleaner, and clearer syntax for creating these objects and dealing with inheritance. ES6 classes provide support for constructors, instance and static methods, (prototype-based) inheritance, and super calls.
So far, JavaScript lacked one of the most basic features - modules. Before ES6, we wrote modules using either CommonJS or AMD. ES6 brings modules into JavaScript ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access