Public members: Members defined by modifying the prototype attribute of the constructor can be accessed by all instances of the constructor;
Private Members: Construct the Members defined by books (VaR for attributes and function for functions), which can only be accessed within the constructor;
Static members: Members directly defined on the object can only be accessed by this object;
Privileged Member: A member defined by this in the constructor. The access permission is the same as that of a public member;
The following example shows the Members in this set.
// Constructor <br/> function myconstructor (Message) <br/>{< br/> This. mymessage = message; </P> <p> // Private Attribute <br/> var separator = '-'; <br/> var myowner = this; </P> <p> // Private method <br/> function alertmessage () <br/> {<br/> alert (myowner. mymessage); // if this is an instance that represents the private method, rather than an instance of the myconstructor constructor, you cannot use <br/>}< br/> alertmessage (); </P> <p> // privileged method <br/> This. appendtomessage = function (string) <br/>{< br/> This. mymessage + = separator + string; <br/> alertmessage (); <br/>}< br/> // public method <br/> myconstructor. prototype. clearmessage = function (string) <br/>{< br/> This. mymessage = ''; <br/>}< br/> // static attribute <br/> myconstructor. name = 'jeff '; <br/> // static method <br/> myconstructor. alertname = function () <br/>{< br/> alert (this. name); <br/>}