Created
April 7, 2016 02:24
-
-
Save edgar/e277dac1c03ef813e95e944b5a7fec70 to your computer and use it in GitHub Desktop.
Handling everything as an Array instead of having conditional
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
Array(1) | |
=> [1] | |
Array([1,2]) | |
=> [1,2] | |
Array(nil) | |
=> [] | |
[*1] | |
=> [1] | |
[*[1,2]] | |
=> [1,2] | |
[*nil] | |
=> [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment