Skip to content
instance method

Array#concat

(*::Array[Elem] arrays) -> self
concat(*other_arrays) → self

Adds to self all elements from each array in other_arrays; returns self:

Example
a = [0, 1]
a.concat(['two', 'three'], [:four, :five], a)
# => [0, 1, "two", "three", :four, :five, 0, 1]

Related: see Methods for Assigning.

See also #compact! #count #compact #cycle also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0