List.last
last($numItems=1) -> any
Description
Return the last item or the last $numItems
items in the List.
['a', 'b', 'c'].last() //= 'c' ['a', 'b', 'c'].last(2) //= ['b', 'c'] ['a', 'b', 'c'].last(5) //= (error)
Return the last item or the last $numItems
items in the List.
['a', 'b', 'c'].last() //= 'c' ['a', 'b', 'c'].last(2) //= ['b', 'c'] ['a', 'b', 'c'].last(5) //= (error)