creating method in js insdie an object code example
Example 1: function inside object javascript
var obj = {
func: function(a, b) {
return a * b;
}
};
obj.func(3, 6); // 18
Example 2: adding function to objects js
var myObj = {
myFunc: function(param){
//do stuff
}
}