Many Kotlin collections have a map() function. It takes a lambda expression that accepts a single element from the collection as a parameter. map() then returns another collection, containing the result of evaluating the lambda expression for each of the elements in the original collection.

You can learn more about this in:
Run Expand Edit