Last active
August 29, 2015 13:56
-
-
Save fresh5447/9102084 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
def hash_to_array(h = {}) | |
a = [] | |
h.each do |word, index| | |
a << "#{word} is #{index}" #build on the array | |
end | |
# h.each {|word, index| a << "#{word} is #{index}" } | |
a #return the array | |
end | |
# {name: "Bob"} | |
#hash_to_array({name: "Bob"}) | |
# ["name is Bob"] | |
#hash_to_array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment