If you mean for collections, yes: <https://kotlinl...
# getting-started
r
If you mean for collections, yes: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map.html Swift:
Copy code
var numberArray = [1, 2, 3, 4, 5]
var newArray = numberArray.map { $0 * 2 }
Kotlin
Copy code
val numberArray = intArrayOf(1, 2, 3, 4, 5)
val newArray = numberArray.map { it * 2 }
(I'm not familiar with Swift. I grabbed that from an example, so I have no idea if it's idiomatic.)
👍 1