store function in object with parameter code example
Example: js functions inside of objects
var person = {
name: "Fred",
sayName: function() {
console.log(this.name);
}
};
person.sayName();
var person = {
name: "Fred",
sayName: function() {
console.log(this.name);
}
};
person.sayName();