comparing traditional functions to arrow functions

Solutions on MaxInterview for comparing traditional functions to arrow functions by the best coders in the world

showing results for - "comparing traditional functions to arrow functions"
Dante
02 Jan 2019
1// Traditional Function
2function (a){
3  return a + 100;
4}
5
6// Arrow Function Break Down
7
8// 1. Remove the word "function" and place arrow between the argument and opening body bracket
9(a) => {
10  return a + 100;
11}
12
13// 2. Remove the body braces and word "return" -- the return is implied.
14(a) => a + 100;
15
16// 3. Remove the argument parentheses
17a => a + 100;
18