DEV Community

Discussion on: Understanding Array.prototype.flatMap

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

Is there a way to pass Infinity into flatmap()? Or would you need to do a Array.flatMap(itme => item).flat(Infinity) roundabout to get that effect? (I'm not even sure if this would be particularly useful in any scenario)

Collapse
 
laurieontech profile image
Laurie

Not that I've seen. I think the way to do it would be the second example you listed.