July 2018
Intermediate to advanced
266 pages
7h 11m
English
Iterators are particularly useful to go through a collection of elements in order. Some characteristics of Kotlin's iterators are:
To create a suspending iterator, we use the builder buildIterator(), passing it a lambda with the body of the iterator. This will return an Iterator<T> where T will be determined by the elements that the iterator yields, unless otherwise specified:
val iterator = buildIterator { yield ...
Read now
Unlock full access