Created
November 18, 2015 22:10
-
-
Save IanWhitney/4c98529556e455dd84e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1,2,3][3] | |
#=> nil | |
# Ask for element outside of the array, get nil. cool. | |
[1,2,3][3,1] | |
#=> [] | |
#=> Ask for a 1-element slice that starts outside of the array, get an empty array. Ok? | |
[1,2,3][4] | |
#=> nil | |
# Ask for element 2 spots outside of the array, get nil. Ok, so the slice behavior should be the same. | |
[1,2,3][4,1] | |
#=> nil | |
#=> Nope! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment