Logo

Programming-Idioms

History of Idiom 165 > diff from v8 to v9

Edit summary for version 9 by Florent:
New Scala implementation by user [Florent]

Version 8

2017-11-09, 21:23:05

Version 9

2017-11-14, 15:05:39

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
// Assuming list is a valid list
list.takeRight(1)