Methods

A method is a property that is a function


var myObject = { 
   myMethod1 : function(params) {
   }
   myMethod2(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




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