Wrapping Up
The syntax for creating classes in modern JavaScript is on par with many other languages that support the object-oriented paradigm. A number of traps that troubled programmers in the past have been closed with the updated syntax and behavior of classes. It is less noisy and less error prone to define classes, define methods and properties, and define getters and setters. In addition to creating classes, we can create dynamic anonymous classes using class expressions. In this chapter, after learning how to create your own classes, you also learned how to use the new Set, Map, and their weak reference alternatives that are kind to memory usage.
JavaScript has also significantly improved inheritance, and we’ll focus on that in the next ...
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