JavaScript

This Keyword

Definition

A special keyword that refers to the object a function is called on. Its value depends on how a function is invoked: in a method, `this` refers to the owner object; in a regular function, it defaults to `globalThis` (or `undefined` in strict mode).

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms