array.flatMap()
maps over each element and flattens it afterwards
Links
Description of array.flatMap() on MDN.
Blog post on flat and flatMap, on the v8 blog.
"#SmooshGate FAQ"
".flatMap(): mapping to zero or more values " by Axel Rauschmayer
Required Knowledge
- `array.flat()` (Array API)
Related Katas
Array API
array.sort()
basicsarray.sort()
can take a compare functionarray.shift()
(as introduced in ES3)array.push()
(as introduced in ES3)Array.from()
Array.of()
array.fill()
array.find()
array.findIndex()
array.entries()
array.keys()
array.values()
array.includes()
array.toReversed()
Difficulty Level
INTERMEDIATE