Tips and Traps¶
- Notice that Iterable.map
returns a List instead of an iterator.
Since almost all collections in Kotlin eventually inherit from
Iterable
, themap
method of all collections (includingHashMap
) in Kotlin returns List.
In [ ]:
Iterable
,
the map
method of all collections (including HashMap
) in Kotlin returns List.