ary.last â obj or nil
ary.last(n) â new_ary
ary.last(n) â new_ary
Instance Public methods
Returns the last element(s) of self
. If the array is empty,
the first form returns nil
.
See also #first for the opposite effect.
a = [ "w", "x", "y", "z" ] a.last #=> "z" a.last(2) #=> ["y", "z"]
Please login to continue.