Mega Code Archive

 
Categories / Ruby / Array
 

Concatenate is with the method

yrs = [1999] yrs << 2000 # => [1999, 2000] # You can chain these, too: yrs << 2001 << 2002 << 2003 # => [1999, 2000, 2001, 2002, 2003]