reversed
Returns a list with elements in reversed order.
fun <T> Array<out T>.reversed(): List<T>(source)
val words = arrayOf("kotlin", "is", "fun")
val reversedWords = words.reversed()
println(reversedWords) // Output: [fun, is, kotlin]
Returns a list with elements in reversed order.
fun <T> Array<out T>.reversed(): List<T>(source)
val words = arrayOf("kotlin", "is", "fun")
val reversedWords = words.reversed()
println(reversedWords) // Output: [fun, is, kotlin]