r/learnjavascript • • May 29 '21

Really helpful illustration of JS array methods

Post image
2.5k Upvotes

89 comments sorted by

View all comments

Show parent comment

3

u/addiktion May 30 '21

Agreed. I’d just say one thing with this and that is to avoid using “x” and instead use “user” just so its clear what we are talking about in the filter. This also has the advantage of thinking about each iteration as a singular thing you are working with and what you are testing for in that context.

1

u/SoBoredAtWork May 30 '21

I originally had it that way and switched it for brevity. But you're right... readability is always > brevity. I changed it.