Array API Reference
Ruby's Array — an ordered, integer-indexed collection of any objects, with rich functional methods.
Array
Arrays are ordered, integer-indexed collections of any object.
Array#push(*objects) -> ArrayAppends each given object to self. Returns self (with aliases <<).
Returns: Array
Array#pop -> object | nilRemoves and returns the last element of self, or nil if the array is empty.
Returns: Object | nil
Array#length -> IntegerReturns the number of elements in self. Alias: size.
Returns: Integer
Array#each {|item| block} -> ArrayCalls the given block once for each element in self, passing that element as a parameter.
Returns: Array
Array#map {|item| block} -> ArrayReturns a new array containing the values returned by the block for each element. Alias: collect.
Returns: Array
Array#select {|item| block} -> ArrayReturns a new array containing all elements for which the block returns a truthy value.
Returns: Array
Array#include?(object) -> boolReturns true if the given object is present in self, false otherwise.
Returns: Boolean
Array#join(separator=$,) -> StringReturns the concatenation of all elements converted to strings, joined by separator.
Returns: String