const person = {
firstName: 'John',
age: 30,
greet() {//method
console.log('Hi, I am ' + this.name);
},
age(){//method
console.log('I am ' + this.age + ' years old');
}
}
person.lastName = 'Doe';//add property to object
console.log(person.lastName);// output: Doe
// Calling a method
person.greet();// output: Hi, I am Doe
person.age();// output: I am 30 years old