Home > Article > Web Front-end > There are 4 different types of properties and methods of JavaScript objects_js object-oriented
The first type is the private type mentioned earlier. Its characteristic is that it is completely inaccessible to the outside world. To access them, you can only use specific getters and setters.
The second type is a dynamic public type. Its characteristic is that it can be accessed by the outside world, and each object instance holds a copy, and they will not affect each other.
The third type is a static public type, or commonly called a prototype attribute. Its characteristic is that each object instance shares a unique copy, and its modifications will affect each other.
The fourth type is class attribute, which is characterized by being an attribute of the type rather than an attribute of the object instance. It can also be accessed when the object is not constructed. The following examples illustrate the characteristics and differences of these four attribute types: Four attributes of type