Back to Developer Roadmap

flatMap

src/data/roadmaps/scala/content/[email protected]

4.0771 B
Original Source

flatMap

The flatMap method is used to apply a function to each element of a collection and then flatten the results into a new collection. It is essentially a combination of the map method followed by the flatten method, but this seemingly very simple property makes it fundamental for Functional Programming.

Visit the following resources to learn more: