Nielsen Interview Question

What is the difference between a map and a flatMap in Scala

Interview Answer

Anonymous

Jun 20, 2018

junior question. I was shocked by this low-level question. the answer is that a flatMap is applied when the items in the list could be Optional or inner-list so it flattens them. like calling map and than flatten.