DEV Community

Discussion on: Understanding Array.prototype.flatMap

Collapse
georgecoldham profile image
George

I have never really understood a use for this. I feel like it is useful, but I just cant find how!

Collapse
laurieontech profile image
Laurie Author

It's a functional programming pattern for sure.

Collapse
georgecoldham profile image
George

I love functional programming, its what I push for all my code to be where possible (I often work with other peoples code bases).

I just cant think of a situation where I have got an array that I both need to iterate over and flatten at the same time.

Thread Thread
laurieontech profile image
Laurie Author

Seems like this has some good ones! 2ality.com/2017/04/flatmap.html