Skip to content

Instantly share code, notes, and snippets.

@edgar
Created April 7, 2016 02:24
Show Gist options
  • Save edgar/e277dac1c03ef813e95e944b5a7fec70 to your computer and use it in GitHub Desktop.
Save edgar/e277dac1c03ef813e95e944b5a7fec70 to your computer and use it in GitHub Desktop.
Handling everything as an Array instead of having conditional
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