Home > Article > WeChat Applet > ES6 new features development WeChat applet (3)
Class(Class)
Class is one of the most important features introduced in ES6. Before Class, we could only simulate classes through the prototype chain.
Class Definition (class definition)
##The above defines a Shape class, it has an attribute name and a method move(), as well as a constructor.
Call the Shape class
Class Inheritance(Class Inheritance)
Inherit a class through the keyword extends, and refer to the parent class through the super keyword.
Getter/Setter
##Static Members
Class equivalent Based on the prototype of the instance, all methods defined in the class will be inherited by the instance. If the static keyword is added before a method, it means that the method will not be inherited by the instance, but will be called directly through the class. This is called a "static method".
Static properties refer to the properties of the Class itself, i.e. Class.propname, rather than defined in the instance Properties on the object (this)
The above is the detailed content of ES6 new features development WeChat applet (3). For more information, please follow other related articles on the PHP Chinese website!