Function bindings and this

A function's bindings refer to a set of additional and implicit values that JavaScript makes available for referencing within the body of the function. These bindings include the following:

  • this: The this keyword refers to the execution context of a function's invocation
  • super: The super keyword in a method or constructor refers to its super-class
  • new.target: This binding informs you as to whether the function was invoked as a constructor (via the new operator)
  • arguments: This binding provides access to the arguments that are passed to a function when it is invoked

These bindings are available to all functions except those defined with the arrow syntax (fn = () => {}). Functions defined in this way will effectively absorb the bindings from the parent scope (if one is available). Each of these bindings has unique behaviors and constraints. We will explore these in the following subsections.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.247.196