No parameter amount arrow function
If the function does not have arguments, we can say by (), is not some force lattice, see example
Const FULLNAMES5 = Names.map (() = ' Cool Bos '); Console.log (FULLNAMES5); Cool Bos, cool Bos, cool BOS
There is another way to do this is to use the underscore _ instead of ()
Names.map (_=> ' Cool Bos ');
Of course, this underline doesn't make any sense, you can do it, but it doesn't mean anything.
Names.map (x = ' cool bos '), names.map (Wesbos = ' cool Bos '), names.map (_ya___yayayayay = ' cool bos '); Names.map ( Do_yaget_the_point = ' Cool Bos ');
An arrow function is an anonymous function
Look at a function with a name saymyname.
function Saymyname (name) { alert (' Hello ${name} ');}
A named function is handy for coder to find errors and clear functions.
But the arrow function is an anonymous function, what should I do? We can use a variable, for example:
Const SAYMYNAME = (name) + {alert (' Hello ${name}! ')}saymyname (' Wes ');
If you think this article is good, want to give Kumaji (Li Ming) to reward?
Javascript Arrow Function 2