Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinFlow cold streamsSingle-choice MCQ

What is the output order of this Flow that uses `onEach` and a terminal `collect`?

import kotlinx.coroutines.flow.* suspend fun run() { flowOf(1, 2) .onEach { println("emit $it") } .collect { println("collect $it") } }