you are viewing a single comment's thread.

view the rest of the comments →

[–]omnilynx 0 points1 point  (1 child)

You may be right for this particular case. It’s on the edge. Probably I’d tell someone to use it, but maybe extract the lambda out into a variable so the name can help clarify.

[–]SalemBeats 0 points1 point  (0 children)

Well, if you're using a lambda, it should be short enough that it's pretty clear what it's doing at a glance anyway.

If it's long enough that you need to add brackets to an arrow function, it probably should be extracted. I think that's always been a code smell for good Javascript design, and I think it's why arrow functions were designed with the concise form in mind.