3 ms·
They are not equivalent - for loop prescribes the ordering of processing, but map and filter can work in any order. They are often associated with FP because to
by js8 7y ago
They are not equivalent - for loop prescribes the ordering of processing, but map and filter can work in any order. They are often associated with FP because to define these operators, you need to be able to pass functions as parameter to other functions, which is a thing that surprisingly many languages struggle with.