Private method: The private method itself is accessible to all properties within the class, that is, the private property and the public property. However, private methods cannot be called outside the class.
Public method:
1. Public methods can be called outside of the class,
2. However, it does not have access to the private properties of the class.
3. The public method must be added inside or outside the class through the prototype property of the class.
Privileged methods:
1. Privileged methods can be called outside of the class,
2. However, it can access the private properties of the class, and it can also access the public properties of the class, and can reluctantly consider it to be a special public method.
3. However, it differs from the declaration and definition of the public method above. The privileged method must declare the definition within the class.
A "Private variable" is declared inside an object using the ' var ' keyword, and it can only be accessed by private functions and privileged methods.
"Private method" is declared in the object's constructor (or through Varfunctionname=function () {...} To define),
It can be called by privileged methods (including object construction methods) and private method calls, and private functions can only access private methods and properties.
"Privileged Method" through This.methodname=function () {...} To declare and possibly be called by code outside the object.
It can use the: this privilege function () method to invoke the privileged function, using the: Private Function () method to invoke the private function.
Public properties are defined by This.variablename and can be read and written outside of the object. cannot be called by a private function.
"Public method" through Classname.prototype.methodname=function () {...} To define can be called from outside the object.
The "prototype attribute" is defined by Classname.prototype.propertyname=somevalue.
Static properties are defined by Classname.propertyname=somevalue.
The static method is defined by the classname.funname=function () {...}.
Static method properties can only be called by the class itself
The attribute method in JS's function 4