Skip to main content

One doc tagged with "this in promises"

View All Tags

this Keyword in JavaScript

In this tutorial, we will learn about the `this` keyword in JavaScript. The `this` keyword refers to the object on which a function is being invoked. The value of `this` depends on how a function is called. We will see how `this` works in different contexts such as functions, methods, constructors, arrow functions, event handlers, callbacks, nested functions, global scope, strict mode, modules, classes, prototypes, async functions, promises, generators, iterators, destructuring, spread operator, rest parameters, default parameters, computed properties, dynamic properties, getters, setters, static methods, private methods, public methods, protected methods, instance methods, static properties, private properties, public properties, protected properties, instance properties, static accessors, private accessors, etc.