Closed gumbol closed 3 years ago
following the ch3 arrow functions definition explanation.
this function definition throws a malformed arrow function error. arr = [ele] => ele >1;
this however works arr = ([ele]) => ele > 1;
it seems that arrays are not treated as a single parameter.
Only plain parameters allow you to omit the parentheses for a single parameter. When destructuring or adding a default value, you always have to include them.
awesome thanks!
following the ch3 arrow functions definition explanation.
this function definition throws a malformed arrow function error. arr = [ele] => ele >1;
this however works arr = ([ele]) => ele > 1;
it seems that arrays are not treated as a single parameter.