← All freeCodeCamp videos

The "this" keyword can be tricky. Ania helps you sort out one of its quirks here.

18,375 views 86 likes 2025-12-05 0:16 Watch on YouTube ↗ freeCodeCamp ↗
FrontendJavaScript

Chapters

No chapter markers in this video's description.

Show the creator's full description
Arrow functions don't have their own 'this'! They inherit it from the parent scope. So obj.name is undefined here. Use regular functions when you need 'this' to refer to the object!

Description and video by freeCodeCamp.org. This page is an independent companion view; the video is embedded from YouTube.