Objects with Methods
Methods are functions inside objects. Use this to access other properties in the same object.
const calculator = {
add: function(a, b) {
return a + b;
},
subtract(a, b) {
return a - b;
}
};
calculator.add(5, 3);
calculator.subtract(10, 4);