3 ms·
I prefer iterators in concise places like this, but loops when there's a bit more logic inside.
by carlmr 7y ago
I prefer iterators in concise places like this, but loops when there's a bit more logic inside.
- kevincox 7y agoDefinitely. If your logic flow naturally maps to common iterator methods I think it helps readability. If you need complex control flow it is best to use a loop then try to wrangle iterator methods to achieve it.