Lesson 31: Mastering JavaScript Object Methods and this concept with challenges!
π What Are Object Methods?
An object method is a function stored as a property on an object β a way for objects to perform actions.
let user = {
name: "Alice",
greet() {
console.log(`Hi, I'm ${this.name}`);
}
};
user.greet(); // "Hi, I'm ...
javascript-day-1.hashnode.dev6 min read