What is Class class?
MDN says that classes define the characteristics of objects. It is a template definition of the properties and methods of an object.
Simply put, "class" is a template for producing objects. Through the class template, countless identical objects can be produced effortlessly without having to declare the object through definitions again and again. Because these objects have the same attributes and methods, these objects are classified into a "class", just like humans are classified into the human category.
JavaScript classes
Before the emergence of es 6, there was no official specification of classes in the ECMAScript standard, and JavaScript classes were simulated through other methods. definition. Until the arrival of the ES 6 standard, JavaScript had an official way to define classes.
The above is the detailed content of What is js class. For more information, please follow other related articles on the PHP Chinese website!