Method: Array#rest

Defined in:
lib/jinx/helpers/array.rb

#restArray Also known as: tail

Returns an array containing all but the first item in this Array. This method is syntactic sugar for self[1..-1] or last(length-1).

Returns:

  • (Array)

    an array the tail of this array



27
28
29
# File 'lib/jinx/helpers/array.rb', line 27

def rest
  self[1..-1]
end