Methods

A method is a property that is a function


class myClass = { 
   method_One() : boolean {
   }

   method_Two : function(params) {
   }
   method_Two(params) {
   }
}


var myObject = { 


   method_One : function(params) {
   }

   method_Two(params) {
   }
}

Sharing Methods


class_Example.prototype.phone = "text";


Property being on the prototype means it is shared
Property being on the constructor means it is instance data




© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext