asReversed

fun <T> List<T>.asReversed(): List<T>(source)

Returns a reversed read-only view of the original List. All changes made in the original list will be reflected in the reversed one.

Since Kotlin

1.0

Samples


@JvmName(name = "asReversedMutable")
fun <T> MutableList<T>.asReversed(): MutableList<T>(source)

Returns a reversed mutable view of the original mutable List. All changes made in the original list will be reflected in the reversed one and vice versa.

Since Kotlin

1.0

Samples