check if it is the last item in kotlin array code example
Example 1: last element of an array kotlin
myList.last()
Example 2: kotlin last element of array
// Use the last() function
var intArray = arrayOf(10, 20, 30, 40, 50)
println(intArray.last())
// Returns 50