JS: Function Call, Apply, Bind

By Xah Lee. Date: . Last updated: .

In JavaScript, any function defined by function , when called, has a associated value called “this binding”.

In function body, the value of “this binding” is represented by the keyword this.

[see JS: “this” Binding]

When a function f is called in the form x.f(…), the value of “this binding” is the object x.

The following are ways to let you call a function and explicitly pass a value of your choice for this binding.


f.call(obj, arg1, arg2 …) → evaluate f(arg1, arg2 …) with f's this keyword having value of obj.

[see JS: Function.prototype.call]


f.apply(obj, array) → evaluate function f with f's this keyword have value of obj, and elements of the array array is passed to the function as arguments.

[see JS: Function.prototype.apply]


Reflect.apply ( f, this_binding, argList ) → Call f with its this keyword having value of this_binding, and with arguments of elements in argList.

[see JS: Reflect.apply]


f.bind(obj) → return a function such that it has the same behavior as f except f's this value is always obj.

f.bind(obj, args …) → the new function will always be given the arguments args.

[see JS: Function.prototype.bind]

Function Topic

  1. JS: Define Function
  2. JS: Functional Programing
  3. JS: Arrow Function
  4. JS: Function Parameters
  5. JS: f Declaration vs Expression
  6. JS: Closure
  7. JS: Function Call, Apply, Bind
  8. JS: Function Argument Default Value
  9. JS: Function Rest Parameters
  10. JS: Function Argument Destructure
  11. JS: Function Object
  12. JS: Function.prototype
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS Basics
  4. JS in Depth
  5. JS Reference
  6. DOM
  7. SVG
  8. JS Misc