Classes

JavaScript has classes that provide a much simpler and clearer syntax for creating constructors and dealing with inheritance. Until now, JavaScript never had the concept of classes, although it's an object-oriented programming language. Programmers from other programming language backgrounds often found it difficult to understand JavaScript's object-oriented model and inheritance due to the lack of classes.

In this chapter, we will learn about object-oriented JavaScript using classes:

  • JavaScript data types
  • Creating objects the classical way
  • The constructors of the primitive types
  • What are classes?
  • Creating objects using classes
  • Inheritance in classes
  • The features of classes

Get Learn ECMAScript - Second Edition 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.