JavaScriptMedium
Explain the different ways the this keyword can be bound
By FrontendPro Editorial Team Updated 8/8/2026
#JavaScript
Answer
The this keyword in JavaScript can be bound in several ways:
- Default binding: In non-strict mode,
thisrefers to the global object (window in browsers). In strict mode,thisisundefined. - Implicit binding: When a function is called as a method of an object,
thisrefers to the object. - Explicit binding: Using
call,apply, orbindmethods to explicitly setthis. - New binding: When a function is used as a constructor with the
newkeyword,thisrefers to the newly created object. - Arrow functions: Arrow functions do not have their own
thisand inheritthisfrom the surrounding lexical context.
