Create Your Own Reduce Function in Swift

There’s an Iterator…and…

Steven Curtis

--

Photo by Noah Buscher on Unsplash

Reduce makes an Array a single function that is it combines all of the given elements in an array and outputs a single value (more on that in a minute) — according to the function we give it.

How is that implemented? What do we do?

--

--