Skip to content

Instantly share code, notes, and snippets.

@bkempner
Created September 10, 2011 01:28
Show Gist options
  • Save bkempner/1207802 to your computer and use it in GitHub Desktop.
Save bkempner/1207802 to your computer and use it in GitHub Desktop.
pry(main)> a = [1,2,3]
=> [1, 2, 3]
pry(main)> a[2..3]
=> [3]
pry(main)> a[3..4] # out of bounds?
=> []
pry(main)> a[3]
=> nil
pry(main)> a[4]
=> nil
pry(main)> a[4..5]
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment