Array#map
and Array#filter
both create a new array, effectively iterating over the original array each time.
In languages like rust, python, java, c#, etc., such expression chains only iterate once, making them more efficient in certain cases.
While this may not be a concern in most scenarios, there are situations where the performance impact could be significant when using the function api of the Array
class.
How do you address this issue? Do you have a preference for a library that enables lazy evaluation for functional expressions?