3 ms·
> All of these things iterate over a collection but all have different run times. List comprehensions return a list, and map returns something, while a for loo
by mr_toad 3y ago
> All of these things iterate over a collection but all have different run times.
List comprehensions return a list, and map returns something, while a for loop doesn’t necessarily return anything. I’d expect the overhead of constructing the returned object has an impact on performance.