Get the first item out of a Ruby array in a hash

Viewed 40554

I have a Ruby hash that looks like this:

h = {"side1"=>["green", "Green"], "side2"=>["verde", "Verde"]}

How can I get the first (or last) item at a particular key in the hash?

4 Answers
Related