Created
May 14, 2015 10:16
-
-
Save shinkbr/08e9e3cc32f9c275c34e 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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
h1 = Hash.new(0) | |
h1[:a] += 1 | |
p h1 #=> {:a=>1} | |
h2 = Hash.new({a: 0}) | |
h2[:a][:a] += 1 | |
p h2 #=> {} | |
p h2[:a] #=> {:a=>1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment