Arrow Function

Arrow Function

An arrow function, or arrow function expression, is a way in JavaScript to define a function that has a few differences when compared to a standard function.

Some of the main differences are as follows:

  1. An arrow function cannot bind their own "this", "arguments", or "super", and instead it can access the ones from its parents scope.
  2. The syntax, it is shorter to create an arrow function.
  3. The return, anything to the right hand side of an arrow function will be returned so you do not always need to wrap your code in curly braces.
  4. An arrow function cannot be used as a constructor.

Further resources

Related topics

© 2024 MWXYZ