javascript using objects with functions 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();