# Object Methods & this — JavaScript Fundamentals: From Syntax to Async

Source: https://www.skillbyai.com/en/javascript/js-object-this

> Define object methods and learn how this is bound, including the lost-this problem with callbacks.

## Methods

A function stored as a property is a **method** — call it with `object.method()`.

```js
const dog = {
  name: "Rex",
  bark() {
    return `${this.name} says Woof!`;
  },
};
console.log(dog.bark());  // Rex says Woof!
```

## What this refers to

Inside a regular method, `this` refers to the object the method was called **on** — not where it was defined.

## Losing this

Passing `dog.bark` as a standalone callback loses its `this` binding — use `.bind()` or an arrow wrapper to fix it.
