What does “this” refer to in JavaScript?

To understand “this,” we need to check our understanding of JavaScript fundamentals. Do I know what an “execution context” and “invocation” is? As a recap, the “execution context” is the environment in which the block of code is invoked. This concept is extremely important because the value of “this” is the execution context. “Invocation” is when parentheses are used to call a function.

The value of “this” is determined by the current execution context of the function being invoked. Often, the execution context is the object that called the function…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store