ForgeFrontend — Prepare, Practice, Crack
Secure checkout
Lifetime access
Instant Drive delivery
Free updates forever

Prepare · Practice · Crack

What's the difference between call, apply and bind?

Quick answer

All set `this`. call passes args individually and invokes now; apply takes an args array and invokes now; bind returns a new function with `this` fixed for later.

In detail

`fn.call(ctx, a, b)` and `fn.apply(ctx, [a, b])` invoke immediately, differing only in argument form. `fn.bind(ctx, a)` doesn't invoke — it returns a new function permanently bound to ctx (and optionally pre-filled args, i.e. partial application). With spread, apply is rarely needed: `fn(...args)`.

1function intro(role) { return `${this.name}${role}`; }
2const p = { name: "Arun" };
3intro.call(p, "FE");      // "Arun — FE"
4intro.apply(p, ["Lead"]); // "Arun — Lead"
5const bound = intro.bind(p);
6bound("Mentor");          // "Arun — Mentor"

Why interviewers ask this: Tests command of explicit `this` binding.

This is 1 of 118+ questions in the JavaScript Interview Kit

Get every question with detailed answers, follow-ups and real code — plus coding challenges and a last-minute revision sheet. One-time payment, instant access.

⚡ Get the JavaScript Interview Kit → ₹299

Full kit

JavaScript Interview Kit · ₹299

Get it →