What is the use case for flatMap vs map in kotlin
Consider the following example: You have a simple data structure Data with a single property of type List. class Data(val items : List<String>) val dataObjects = listOf( Data(listOf(“a”, “b”, “c”)), Data(listOf(“1”, “2”, “3”)) ) flatMap vs. map With flatMap, you can “flatten” multiple Data::items into one collection as shown with the items variable. val items: … Read more