Ben Chuanlong Du's Blog

It is never too late to learn.

Iterator in Kotlin

Tips and Traps

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

Comments