js create object function code example
Example 1: adding function to objects js
var myObj = {
myFunc: function(param){
//do stuff
}
}
Example 2: javascript construct new object
person = new Object();
var myObj = {
myFunc: function(param){
//do stuff
}
}
person = new Object();