Object-oriented (object-oriented, OO) languages have a sign that they all have the concept of a class, and that a class can create any number of objects with the same properties and methods. There is no class concept in ECMAScript, so we can use objects to simulate the class. ECMA-262 defines an object as: "A collection of unordered attributes whose properties can contain basic values, objects, or functions." "Strictly speaking, this is equivalent to saying that the object is a set of values that do not have a particular order. Each property or method of an object has a name, and each name is mapped to a value.
Here are the methods of creating objects described in the JavaScript Advanced Programming program, which I have always formed in mind mapping mode:
The most widely used is the combination of the constructor pattern and the prototype pattern. In addition, the dynamic prototype pattern is also popular, functionally equivalent to the constructor mode/prototype mode. Either of these two approaches can be used. Do not use the classic constructor or prototype schema alone, however, because it introduces problems to your code.
Creating Objects ("JavaScript advanced Programming" mind mapping)