10 Things Every Java Programmer Should Know About Ruby

Another RI Example

Ask about the instance method last

$ ri Array#last
------------------------------------------------------------- Array#last
     array.last     =>  obj or nil
     array.last(n)  =>  an_array
------------------------------------------------------------------------
     Returns the last element(s) of _self_. If the array is empty, the
     first form returns +nil+.

        [ "w", "x", "y", "z" ].last   #=> "z"