class is used to define a class:
This syntax is called a class declaration.
Methods in the class are not comma separated
Class syntax differs from object literals. No commas are required inside classes.
The class may not have a name. A class expression can be used to assign a class to a variable 🔔:
Classes can be exported as modules. Here's an example of the default export:
And here's an example of a named export:
The class becomes useful when you instantiate the class. An instance is an object that contains the data and behavior described by 🖊️ class.
instance = new Class().
For example, you can create🏗️ an instance of the User class👤 using the
new User() creates an instance of the
User class 👤.
Thanks goes to these wonderful people (emoji key):
🐛 🎨 🖋
🖋 🐛 🎨