Skip to content

Instantly share code, notes, and snippets.

@bostonaholic
Created November 21, 2013 20:14
Show Gist options
  • Save bostonaholic/7588800 to your computer and use it in GitHub Desktop.
Save bostonaholic/7588800 to your computer and use it in GitHub Desktop.
Can anyone explain why Ruby Range#last works in this way?
irb(main):017:0> (1..10).last # OK
=> 10
irb(main):019:0> (1...10).to_a.last # OK
=> 9
irb(main):018:0> (1...10).last # WAT
=> 10
irb(main):020:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment