Class Expressions
Deep dive into the basics of class expressions and learn how to create a class using class expressions.
Class expressions are useful to create dynamic classes at runtime based on, for example, properties you read from a file, database, or user-provided input. Imagine creating a class factory function that will create and return a class; this is a good place to use a class expression.
Difference between class expression and class statement
JavaScript supports both a class statement, which you use to define a class, and a class expression. The two key differences between a class expression and a class statement are:
-
The class name is optional for class expressions but required for class statements. ...
Access this course and 1400+ top-rated courses and projects.