Created
October 16, 2015 19:03
-
-
Save rdavila/5212596735d5b370c492 to your computer and use it in GitHub Desktop.
This file contains 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
result = Hash.new(0) | |
result[:foo] += 1 | |
p result # I get { :foo => 1 } good. | |
result = Hash.new([]) | |
result[:foo] << 1 | |
p result # I get {} instead of { :foo => [1] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment