Return to Snippet

Revision: 48462
at July 1, 2011 22:32 by devnull69


Initial Code
// class
var myClass = function(param) {
   // private member
   var myMember = param;
   // private method
   var myMethod = function(whatever) {
   
   };

   //public member
   this.myPublic = 7;
   // public method
   this.myPublicMethod = function(whatelse) {
      
   };
};

// prototype (public)
myClass.prototype.myNewMember = 7;
myClass.prototype.myNewMethod = function() {};

// static
myClass.myStatic = 8;

// object
var myObject = new myClass(7);

Initial URL

                                

Initial Description

                                

Initial Title
Classes objects  prototype and static

Initial Tags
class, object

Initial Language
JavaScript