Turning Learners Into Developers
Codekilla
CODEKILLA
back to course
Lesson 50 / 11543%
Objects4/7

JS this Keyword

What `this` refers to depends on HOW the function is called.

// `this` is decided by HOW the function is called, not where it's writtenregular call fn();window (sloppy) · undefined (strict)method call obj.fn();→ objarrow fn () => { ... }→ lexical (enclosing scope)new Cls(); constructor→ fresh instanceClick each row to see what `this` resolves to.
Visual explanation diagram · click steps to walk through it

This lesson is Pro only.

Unlock every premium lesson and module — Pro from ₹299 / month (or ₹999 / year, saves ~₹2,589).

Sign in to unlock
// feedback.matters()
Did this lesson help you?