Gold Challenge

Use what you have learned in this chapter to clean up the implementation of reduce(_:combine:) presented above. The implementation can be shortened quite significantly: your solution should be expressed in one line. When you are done, take a look at the sample code for the other higher-order functions and practice with them.

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.