DEV Community

Shashi Bhushan Kumar
Shashi Bhushan Kumar

Posted on

Why the this Keyword Feels Confusing in JavaScript

When I started preparing for JavaScript interviews, I realized something —
most confusion doesn’t come from complex topics, but from basic ones we rush through.

The this keyword is a perfect example.

At first, I tried to memorize definitions.
But that never worked in interviews.

What helped me was asking two simple questions every time I saw this:

Where is this function written?

How is this function being called?

That alone explains most cases:

Regular functions get their this from the caller

Arrow functions don’t have their own this

Once I focused on context instead of rules, the topic started making sense.

If you’re learning JavaScript, slow down on the basics.
They matter more than we think.

Top comments (0)