I found that for-loop sometimes is more readable than functional version, but functional version is better in most case.
For example, I will use for-or along with awaitwhen I want to await multiple promises one by one.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
I agree with you about that example being easier to read. I would still prefer consistency in the app and ban all for loops in favor of map reduce and filter.
You could also break the one liner down a bit to help with readability and reusability.
I found that for-loop sometimes is more readable than functional version, but functional version is better in most case.
For example, I will use
for-or
along withawait
when I want toawait
multiple promises one by one.vs
I agree with you about that example being easier to read. I would still prefer consistency in the app and ban all for loops in favor of map reduce and filter.
You could also break the one liner down a bit to help with readability and reusability.