Created
September 1, 2016 18:12
-
-
Save gabericharde/38cb164ccfdd65afcf7340cf248193cb 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
hash = {a: 10, b: 20, c: 30} | |
hash.each {|key| puts key} | |
# for the output of this, i'm getting: | |
# a | |
# 10 | |
# b | |
# 20 | |
# c | |
# 30 | |
# all the documentation i have looked at suggests i should just be getting keys | |
# also used old school nasty hash: | |
grandpa_hash = { "a" => 10, "b" => 20, "c" => 30 } | |
# but i still get the same result with grandpa_hash.each {|key| puts key} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment