ACM@UIUC TIL logo ACM@UIUC TIL

Array#last takes an argument to limit the number of items to return from the tail of a list.

> [1,2,3,4,5].last(2)
# = > [4, 5]