- Arguments binding
- Use of this keyword
- Using a new keyword
- Syntax By writing a few lines of code using arrow functions, a programmer can get the same result as ordinary functions.
- Arguments binding arguments object inside the regular functions contains the list of arguments.
Because an arrow function lacks its own "this" keyword, the behaviour of this inside an arrow function differs significantly from that of an ordinary function.
This inside an arrow function has the same value throughout its lifetime and is always linked to the value of this in the nearest non-arrow parent function, which means This value inside an arrow function always equals this value from the outer function, regardless of how or where it is executed.
- Using a new keyword Regular functions can be built and called. The new keyword can be used to call them.
Inside a normal function, this value is dynamic and changes depending on how the function is called. However, the inner arrow function is lexically bound and equals the outer function. This a value is always bound to the class instance using fat arrow methods.