2 ms·
What I mean is when you have a 200 line for loop that includes other for loops, "continue" statements, if statements and modifying state it gets really confusin
by seanwilson 9y ago
What I mean is when you have a 200 line for loop that includes other for loops, "continue" statements, if statements and modifying state it gets really confusing quickly. If it's short it's probably going to be OK to understand anyway but if you can decompose a long for loop into several map, reduces and filters it's much easy to understand what's going on because it's more linear.
For that example, you should really have a generic "group by" function to use anyway that plays nice with your map, filter and reduce functions.