Suppose I have this:
listOf("ball","apple","zebra","cat")
I want to convert this to:
listOf(Pair("ball","b"),Pair("apple","a"),Pair("zebra","z"),Pair("cat","c"))
Basically I want the second of the Pair to be a value computed using the array value.
I realize I can create this using some combinations of a for loop. But is there a built in way using some function similar to map which does this?