I'm just reading up on ES6 features that have been implemented in Node v4.0.0 and saw Arrows. The example from Arrow Functions is:
var a = [
"Hydrogen",
"Helium",
"Lithium",
"Beryllium"
];
var a2 = a.map(function(s){ return s.length });
var a3 = a.map( s => s.length );
My question is how can I include multiple lines of code inside of a.map( s => s.length ); rather than just returning the length as in this example.
// Basic syntax: (param1, param2, paramN) => { statements } (param1, param2, paramN) => expression // equivalent to: => { return expression; }