Logo

Programming-Idioms

History of Idiom 165 > diff from v47 to v48

Edit summary for version 48 by kailan:
[Kotlin] variable rename

Version 47

2019-09-27, 02:31:07

Version 48

2019-09-27, 02:31:33

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Code
var _x = _items.last()
Code
var x = items.last()
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/last.html
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/last.html
Demo URL
https://pl.kotl.in/SPTNJJD3c
Demo URL
https://pl.kotl.in/SPTNJJD3c