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