JavaScript function ABC: apply(), bind() and call()

  • apply()
    • The apply() method calls a function with a given this value and arguments provided as an array (or an array-like object).
  • bind()
    • The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.
  • call()
    • The call() method calls a function with a given this value and arguments provided individually.
    • Note: While the syntax of this function is almost identical to that of apply(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments.

JsFiddle