|
|
|
|
|
by village-idiot
3434 days ago
|
|
Sure it does. For can be used for any of the following. * Mapping (producing a data structure of the same size/type) * Filtering (producing a data structure of the same type buy smaller) * Side effects * Collecting (producing a different data structure) If you're incredibly unlucky or foolish a for loop might be doing more than one operation at a time! Assuming you're only using the return types, map, filter, and collect are very clear about having only one purpose. If that's not telling you more I don't know what is. |
|