craiggrummitt.com
flatMap vs compactMap
In Swift 4.1, the flatMap function was divided into two functions. One kept the same name: flatMap This method flattens a sequence. Let’s say we have a two-dimensional array: We can use the f…