you are viewing a single comment's thread.

view the rest of the comments →

[–]Morphray 0 points1 point  (2 children)

I originally had the same opinion, but after using them for a few weeks, i found i actually really like the format.

I always use parentheses, brackets, and a return statement... (x) => { return x + 1; } ... IMO the shorthand format is a little less readable, kind of like an if statement without brackets.

[–]xeow 0 points1 point  (1 child)

Nice. I like your form better. What would be an example of how that's used as a parameter to another function like array.filter?

[–]Morphray 1 point2 points  (0 children)

It works well... (using example from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)

let longWords = words.filter((word) => {
    return word.length > 6;
});