DEV Community

Discussion on: Understanding Array.prototype.flatMap

Collapse
 
dukeofetiquette profile image
Adam DuQuette

Code school instructor here, I'd love to see a real-world example in your posts. The simple example is great for the intro, but having a more robust example to solidify might help. I am constantly getting that type of request from students, so I've gotten in the habit of trying to incorporate them during lecture.

That is to say, why are flat() and flatMap() being introduced? Why should a junior developer be excited about these?

Thanks : )

Collapse
 
laurieontech profile image
Laurie

Fair point. Been keeping these intros bite-sized, but I'll certainly consider adding a bit more!