title: What does a range of 2..-1 mean? (Ruby koans about_arrays.rb)
body: <p>Please could someone explain what a range object of <code>2..-1</code> means. </p>
  
  <p>Ruby koans has the following in about_arrays.rb:</p>
  
  <pre><code>def test_slicing_with_ranges
    array = [:peanut, :butter, :and, :jelly]
  
    assert_equal [:peanut, :butter, :and], array[0..2]
    assert_equal [:peanut, :butter], array[0...2]
    assert_equal [:and, :jelly], array[2..-1]
  end
  </code></pre>
  
  <p>The following website (found from another answer) explains how ranges work with slicing:
  <a href="http://www.ruby-forum.com/topic/1393096#990065" rel="nofollow">Gary Wright, string/array slices</a>
  From this, I understand why the split gives the answer it does. The thing I don't understand is WHAT range the range object is referring to. For a normal range, I can do:</p>
  
  <pre><code>(1..3).each { |x| puts(x) }
  </code></pre>
  
  <p>which gives the following output when executed in irb:</p>
  
  <pre><code>1
  2
  3
  =&gt; 1..3e
  </code></pre>
  
  <p>However, <code>(2..-1).each { |x| puts(x) }</code> gives:</p>
  
  <pre><code>=&gt; 2..-1
  </code></pre>
  
  <p>So what does the range <code>(2..-1)</code> mean?</p>