Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created October 27, 2011 16:00
Show Gist options
  • Select an option

  • Save DCarper/1319981 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/1319981 to your computer and use it in GitHub Desktop.
What's the reasoning behind these special cases?!?
a = [0, 2, 3]
a[3, 1] ## => [] # official special case
a[4, 1] ## => nil
a[5, 1] ## => nil
##
a = [0, 1, 2, 3]
a[4, 1] ## => [] # official special case
a[5, 1] ## => nil
a[6, 1] ## => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment