Phase 4 · JavaScript

Topics

this keyword

Part of the Frontend Developer Roadmap.

Summary

A special reference whose value depends on how a function is called (method call, plain call, `new`, or `bind`/`call`/`apply`) — one of JS's most confusing quirks. The key is to reason from the call site: regular functions receive `this` based on invocation, while arrow functions capture `this` lexically from their surrounding scope.

How to Learn This

  • 1Log `this` inside a regular function vs an arrow function vs an object method. Validate your understanding by applying it in a small practical example.
  • 2Practice `bind`, `call` and `apply` to explicitly set `this`. Test it with at least one normal case and one edge case so you can explain the behavior confidently.
  • 3Learn why arrow functions in class methods are often used to avoid `this` bugs.
InsideEdge

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — free on the InsideEdge app.

Download
InsideEdge