|
Answer» Arrow functions are ONE of the major reasons for the popularity of ES6 due to the reasons mentioned below: - Safety of scope: Consistent use of arrow functions guarantee to use the same thisObject as the root. Using the arrow functions provides scope safety because even if a single standard function CALLBACK is mixed with some arrow functions, the probability of scope getting disturb increases.
- Compactness: It is easier to read and write when it comes to arrow functions as compared to other functions. This provides a less COMPLEX approach of using ES6 as well as the arrow functions.
- Provides clarity: A developer can easily identify what “ thisObject” is and find out the next-higher function statement after the arrow function statement if he/she uses arrow function in most of the PROGRAM. It will provide HUGE clarity and easy detection of errors in any program.
|