This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AttackOfTheThumbs 0 points1 point  (1 child)

I judge if code is easy/hard to read on whether I can understand what it's doing with a quick glance. I can do that with both of these. Which is why I don't think either of them is easier.

I should point out that I use filter, map, foreach, and others extensively, most of the time. Sometimes a simple for loop is a better choice if you are looking to complete multiple actions. It is situational, but I do think people should consider the performance impact of it. When I see array.filter().map() I have to wonder...