3 ms·foreach implies mutation. reduce is a way to aggregate a collection into single result in an immutable way.by keymone 9y agoforeach implies mutation. reduce is a way to aggregate a collection into single result in an immutable way.