Course contentsShow
← JavaScript
Lesson 550 of 2,72314. The 'this' KeywordFree lesson

Implicit Binding Rules

Master the rule that 'this' is determined by what's left of the dot at call time.

Implicit Binding Rules

You'll learn the simple rule that determines what this refers to in most method calls: look left of the dot.

The Left-of-the-Dot Rule

When a function is called as a method (using dot notation), this is implicitly bound to whatever object is to the left of that dot at call time. This is called implicit binding because you don't explicitly tell JavaScript what this should be—it figures it out from how you called the function.

The key insight: it's not where the function is defined that matters, but how it's invoked.

The Rule in Action

const user = {
  name: 'Alice',
  greet: function() {
    console.log(this.name);
  }
};

user.greet(); // 'Alice' — 'this' is user (left of the dot)

At call time, look at user.greet(). What's left of the dot? user. So this inside greet refers to user.

Why "Implicit"?

You didn't write greet(user) or pass user as an argument. JavaScript implicitly set this based on the call-site syntax. This happens automatically whenever you use the object.method() pattern.

Analogy

Think of the dot as a delivery address. When you call house.ringDoorbell(), the this inside ringDoorbell is "delivered to" whatever's left of the dot—in this case, house. Change the address (apartment.ringDoorbell()), and this changes too.

Key Takeaway: When you see object.method(), this inside method refers to object—the implicit binding rule uses what's left of the dot at call time.