how to get object from function in javascript 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
}
}