and you need {} as soon as you have more than 1 line of function body
Almost but not completely correct. You need {} when the function body is not just one expression, that is, when you need additional statements before the return value. You can easily write something like
const sum = (array) => array
.reduce( (a,b) => a+b);
Almost but not completely correct. You need
{}
when the function body is not just one expression, that is, when you need additional statements before the return value. You can easily write something likebut you can't do
Good catch! I've edited the post to include your comment and attributed it to you :)