get the last element of a list kotlon code example
Example 1: kotlin last element of array
// Use the last() function
var intArray = arrayOf(10, 20, 30, 40, 50)
println(intArray.last())
// Returns 50
Example 2: last element of an array kotlin
myList.last()