ES6 the introduction of the arrow function has three advantages, first, a concise syntax, and the second, implicit return, can be written as a line, and thirdly, when you perform a click operation, the statement is not inside a function.
Visit Es6.io There are plenty of examples to take a look at.
To add a name to a data:
Const NAMES = [' Wes ', ' Kait ', ' Lux '];
We want to add BOS to the back of each array value.
Usually we do this:
Const FULLNAMES = names.map (function(name) { return ' ${name} Bos '; }); Console.log (Fullnames); Wes Bos, Kait Bos, Lux Bos
Here we use quotation marks, this is the string template, you do not have to worry about the subsequent chapters will be introduced.
We see that each entry of the names array adds BOS to make up the Fullnames
Wes Bos, Kait Bos, Lux Bos
Next look at how the arrow function overrides this sentence.
Convert it to an arrow function
An arrow function simply removes function and adds the east of the character.
Const Fullnames = Names.map ((name) + = { return ' ${name} Bos ';});
Console.log (Fullnames);
Javascript Arrow Function Brief