Skip to content

Instantly share code, notes, and snippets.

@tshddx
Created June 2, 2014 23:34
Show Gist options
  • Save tshddx/f94ecc315c9be897ca32 to your computer and use it in GitHub Desktop.
Save tshddx/f94ecc315c9be897ca32 to your computer and use it in GitHub Desktop.
Some Ruby lols
a = [1,2,3]
# => [1, 2, 3]
enum = a.map!
# => #<Enumerator: [1, 2, 3]:map!>
enum.map(&:to_s)
# => ["1", "2", "3"]
a
# => [nil, nil, nil]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment