elementAtOrNull

suspend fun <E> ReceiveChannel<E>.elementAtOrNull(
    index: Int
): E?
(source)

Platform and version requirements: JVM

Returns an element at the given index or null if the index is out of bounds of this channel.

The operation is terminal. This function consumes all elements of the original ReceiveChannel.