how to add method to javascript object code example Example: adding function to objects js var myObj = { myFunc: function(param){ //do stuff } }