1// => why to choose arrow function over normal function
21. short syntax, good as callback functions
3 ([].map(() => {}) is better than [].map(function () {}))
4
52. when using class component, with arrow functions no need to bind this
6
7// example:
8
9 -// this will be undefined
10 button.addEventListener('click', () => {console.log(this); })
11 // this will refer to dom button
12 button.addEventListener('click', function () {console.log(this); })