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:
- An arrow function cannot bind their own "this", "arguments", or "super", and instead it can access the ones from its parents scope.
- The syntax, it is shorter to create an arrow function.
- 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.
- An arrow function cannot be used as a constructor.