Shortcut for functions, no need to function
create functions with keywords, and keywords can also be omitted return
.
this
At the same time, arrow functions also inherit the keywords of the current context .
The map function is often used in react.
for example:
[ 1 , 2 , 3 ]. map (he => he + 1 ); // [2, 3, 4]
Equivalent to:
[ 1 , 2 , 3 ]. map (( function (he) {
return he + 1 ;
}).bind(this));