Arrow function
-
Arrow functionDynamicPL/Javascript 2019. 10. 24. 17:43
1. Overview Arrow functions which are added in ES6 are so simple and share the surrounding this keyword. Unlike normal function, arrow functions don't get their own "this" keyword. 2. Description 2.1 Expression const years = [1990, 1965, 1982, 1937]; // ES5 var ages5 = years.map(function(el) { return 2016 - el; }); console.log(ages5); // ES6 // a lots less code let ages6 = years.map(el => 2016 -..