DEV Community

Discussion on: Flatten Array using Array.flat() in JavaScript

Collapse
 
nickymeuleman profile image
Nicky Meuleman

Array.flatMap() is also a nice shortcut!
It's equivalent to Array.flat(1).map()

Collapse
 
samanthaming profile image
Samantha Ming

Oh cool! I briefly looked into flatMap...Iโ€™ll have to cover it in a future tidbit then! ๐Ÿ˜†