|
They mean that the forEach runs code per element, but cannot return a transformed list of values, you need map for that. A map can run code per list element but the result must be injective (one-to-one). Reduce can do all of the above, but must return a lower dimension result from its input. And finally, a for loop is basically omnipotent. |
To make that untrue, you need to define very strict limits on what else your language can do.
(Sure, we produce a transformed list here through the use of side effects. But note that the original example sparking the claim that forEach can't do what map can was this:
Side effects are clearly allowed.)