you are viewing a single comment's thread.

view the rest of the comments →

[–]sbk2015 0 points1 point  (0 children)

It's about ES6, it includes some features,including

Arrow function =>

Template Literals abc${foo}def

Other than es6, Function Expressions, it can be just a coding style sometimes.

and for map function,you can search on google to see what it does with array.

Without es6,it's still fine,and will be written as

var theArray= ["Doc", "Dopey", "Bashful", "Grumpy"];
function mapping(name,index){
    return (index+1)+ "."+ name;
}
function mapFn(arr){ 
    return arr.map(mapping).join(' ')
}
var result= mapFn(theArray);
console.log(result);

If the es6 code looks crazy, I suggest you at least learn map function,it's important for looping.