"Content-type"Content="text/html; Charset=utf-8"> <title>test</title> //Object Constructorsfunction Atest (name) {//private properties, which can only be used inside the object constructor varClassName ="atest"; //Public property, called after an object instantiation This. Name =name; //Object Methods This. Hello =function () {alert ( This. Name); Alert ( This. MSG ());//methods that are expanded using the prototype method can be used inside the classAlert This. Sex);//properties that are expanded using the prototype method can be used inside the classalert (atest.age);//a static property is called when the format is [object. Static property] } } //the location of the class method (which is actually called directly by a static method): The external syntax format for the Person class: Class name. Method name = function ([parameter ...]) {statement line;}Atest.run =function () {alert ("I am the class method Run"); } //Prototyping MethodsAtest.prototype.msg =function () {alert ("My name is:"+ This. name);//if the prototype method is called directly as a static method, THIS.name cannot be called } //public static properties outside of classAtest.age = -;//public static properties cannot use the "this. Property" and can only be called by using the object. property.//The prototype property, which is considered to be a property inside the class, uses the "this. prototype attribute", or it can be used as a public static property "object. prototype. prototype Properties"Atest.prototype.sex ="male"; Atest.run (); //class methods are also static methods that you can use directly with the object. static method ()Atest.prototype.msg ();//The prototype method is used as a static method when using the object. Prototype. Method () "alert (Atest.prototype.sex);//The prototype property is treated as a static property when you use the object. Prototype. Method () " varA =NewAtest ("Chenm");//object methods and prototype methods need to instantiate objects before they can be usedA.hello ();//Object methods must instantiate objectsA.msg ();//The prototype method must instantiate the objectalert (a.age);//error, public static property can only be invoked using the object. Property//PS: As far as possible the method is defined as a prototype method, the prototype method avoids each call to the constructor of the property or method construction, save space, create objects faster.</script> </body>Object methods, class methods, prototype methods && private properties, public properties, public static properties