3 ms·
It is not an identity because you can modify the internal state of the objects. And it is also lazy: arrayOf("A","B","C").onEach{ print("onEach $it")}.forEach{
by jorgemf 10y ago
It is not an identity because you can modify the internal state of the objects. And it is also lazy:
arrayOf("A","B","C").onEach{ print("onEach $it")}.forEach{ print("forEach $it")}
prints:
onEach A
forEach A
onEach B
forEach B
onEach C
forEach C
- agumonkey 10y agothanks