at

ary.at(index) â obj or nil
Instance Public methods

Returns the element at index. A negative index counts from the end of self. Returns nil if the index is out of range. See also #[].

a = [ "a", "b", "c", "d", "e" ]
a.at(0)     #=> "a"
a.at(-1)    #=> "e"
doc_ruby_on_rails
2015-03-30 15:26:57
Comments
Leave a Comment

Please login to continue.