https://kotlinlang.org logo
c

cedric

01/16/2018, 2:17 PM
How about
myList.last
?
p

Pavlo Liapota

01/16/2018, 7:19 PM
Something like this? 🙂
Copy code
var <T> MutableList<T>.last
    get() = this[lastIndex]
    set(value) { this[lastIndex] = value }
3 Views