Skip to content

Instantly share code, notes, and snippets.

@mattbriancon
Created August 16, 2011 04:58
Show Gist options
  • Save mattbriancon/1148467 to your computer and use it in GitHub Desktop.
Save mattbriancon/1148467 to your computer and use it in GitHub Desktop.
Why does this work?
ruby-1.9.2-p290 :001 > array = [:peanut, :butter, :and, :jelly]
=> [:peanut, :butter, :and, :jelly]
ruby-1.9.2-p290 :002 > array[4] # makes sense -- 4 is out of range
=> nil
ruby-1.9.2-p290 :003 > array[5,0] # makes sense -- 5 is out of range
=> nil
ruby-1.9.2-p290 :004 > array[4,0] # doesn't make sense -- 4 is still out of range...
=> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment