Logo

Programming-Idioms

History of Idiom 165 > diff from v44 to v45

Edit summary for version 45 by mike:
[Ruby] The #last method is idiomatic.

Version 44

2019-09-26, 18:27:01

Version 45

2019-09-26, 18:40:13

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]
Code
x = items.last