Answers for "Javascript one parameter fat arrow"

0

Javascript one parameter fat arrow

//When there is only one parameter name, you can omit the parentheses around the parameter list. If the body is a single expression, rather than a block in braces, that expression will be returned from the function. So, these two definitions of square do the same thing:
const square1 = (x) => { return x * x; };
const square2 = x => x * x;
Posted by: Guest on September-20-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language