Easy'this' Binding💻 Output Question

Method call — this is the calling object

💡

Hint

Method calls: this = the object before the final dot at the call site.

What does this output?

const obj = {
  name: 'Alice',
  greet() { return 'Hello, ' + this.name; },
};
console.log(obj.greet());

Correct Output

Hello, Alice

Why this output?

Explanation: When called as obj.greet(), this is set to obj — the object to the left of the dot.

Key Insight: Method calls: this = the object before the final dot at the call site.

More 'this' Binding Output Questions

EasyArrow function has no own this — inherits lexicallyMediumbind permanently fixes this — call cannot override itMediumcall vs apply — same result, different syntaxMediumArrow callback inside method preserves this

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz