© Raju Gandhi 2019
R. GandhiJavaScript Nexthttps://doi.org/10.1007/978-1-4842-5394-6_11

11. Many of a Kind with Classes

Raju Gandhi1 
(1)
Columbus, OH, USA
 

Building objects via classes, and organizing them in hierarchies in JavaScript, is hard. Functions, constructors, the prototype property—combine all of these using a secret recipe, sprinkle some magic dust, and voila, we have inheritance, assuming we get all the wiring correct. Without having an intricate understanding of how JavaScript prototypal inheritance works, it feels like its black magic.

In this chapter we will see how we can easily create classes and build inheritance trees in our code using several new keywords like class, extends, and super that were introduced in ES6, allowing us to ...

Get JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.