Logo

Programming-Idioms

History of Idiom 165 > diff from v4 to v5

Edit summary for version 5 by programming-idioms.org:
New Ruby implementation by user [programming-idioms.org]

Version 4

2017-10-23, 10:52:04

Version 5

2017-10-23, 19:15:38

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
x = items[-1]