Hard'this' Binding💻 Output Question

new vs plain call — different returns

💡

Hint

new returns the constructed object. A plain call returns the function's explicit return value — undefined if nothing.

What does this output?

function Person(name) { this.name = name; }
const p1 = new Person('Alice');
const p2 = Person.call({}, 'Bob');
console.log(p1.name);
console.log(p2);

Correct Output

Alice
undefined

Why this output?

Explanation: new creates an object and returns it. Person.call({}, "Bob") sets this on the passed object but since the function returns nothing, call returns undefined.

Key Insight: new returns the constructed object. A plain call returns the function's explicit return value — undefined if nothing.

More 'this' Binding Output Questions

EasyMethod call — this is the calling objectEasyArrow function has no own this — inherits lexicallyMediumbind permanently fixes this — call cannot override itMediumcall vs apply — same result, different syntax

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz