Addy Osmani on Twitter: "JS tip: Array.prototype.flatMap is a lot like map(), except it flattens the result into a new array: https://t.co/jvtr4EnYsQ https://t.co/aF4t2xNQrg" / Twitter
![Master map, compactMap, flatMap, reduce and filter by creating your own implementation – Ken Boreham Master map, compactMap, flatMap, reduce and filter by creating your own implementation – Ken Boreham](https://kenb.us/wp-content/uploads/2018/02/higherOrderSwift.003-2.png)
Master map, compactMap, flatMap, reduce and filter by creating your own implementation – Ken Boreham
![vs — map, flatMap and compactMap. Higher order functions in Swift are… | by Kamal Bhardwaj | Dev Genius vs — map, flatMap and compactMap. Higher order functions in Swift are… | by Kamal Bhardwaj | Dev Genius](https://miro.medium.com/max/1400/1*qWE5Ja7hbQSWLqIPyLhe6g.jpeg)