Instead of [], you can also use the slice method, another alias
year = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]
year.slice(1) # => 2001
year.slice(0,4) # => [2000, 2001, 2002, 2003]
year.slice(0..2) # => [2000, 2001, 2002]
year.slice(0...2) # => [2000, 2001]
Related examples in the same category