Back to search

The this keyword in global scope, methods, regular functions, arrow functions, and call/apply/bind

`this` depends on how a function is called, and `call`, `apply`, and `bind` let you control that context explicitly.

JavaScript Medium Theory

The this keyword in global scope, methods, regular functions, arrow functions, and call/apply/bind

`this` depends on how a function is called, and `call`, `apply`, and `bind` let you control that context explicitly.

  • Arrow functions do not create their own `this`
  • Method calls bind `this` to the receiver
  • `bind` returns a new function

The this keyword in global scope, methods, regular functions, arrow functions, and call/apply/bind