ES6 introduced classes, which are a type of function defined using the class keyword instead of function, with properties assigned inside a constructor() method.
A basic class constructor:
class |
Note the capitalization of the class name; we’ve started “Car” with an uppercase letter. This is a standard convention for naming classes. |
You can now create objects using the Car class: