Logo

Programming-Idioms

History of Idiom 165 > diff from v46 to v47

Edit summary for version 47 by kailan:
New Kotlin implementation by user [kailan]

Version 46

2019-09-26, 20:17:07

Version 47

2019-09-27, 02:31:07

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()
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/last.html
Demo URL
https://pl.kotl.in/SPTNJJD3c