
A method is a function stored as a property of an object. Define it like any other property: const user = { greet() { return 'Hello'; } };. Call it with dot notation: user.greet(). Inside a method, this refers to the object the method belongs to. Methods let objects encapsulate both data and behavior together.
Reference:
TaskLoco™ — The Sticky Note GOAT