0PricingLogin
Kotlin Multiplatform Academy · Lesson

map, filter & fold in Shared Code

Functional collection operators you can rely on cross-platform.

Transform Without Loops

Kotlin gives collections functional operators that transform data cleanly. They all run identically in shared multiplatform code.

map Reshapes Each Item

map applies a function to every element and returns a new list of the results, leaving the original untouched.

val nums = listOf(1, 2, 3)
val doubled = nums.map { it * 2 }

All lessons in this course

  1. Strings, Numbers & Collections Everywhere
  2. map, filter & fold in Shared Code
  3. Dates with kotlinx-datetime
  4. What Is NOT in Common stdlib
← Back to Kotlin Multiplatform Academy