10 Things Every Java Programmer Should Know About Ruby | [ Prev | Home | Next ] |
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"
O'REILLY® OSCON 2005 | Copyright 2005 by Jim Weirich (All Rights Reserved) |