Ruby - Hashes
Which of the following is the correct syntax to iterate over each key-value pair in a Ruby hash
h?h?each{ |key, value| ... }.h.each { |key, value| puts key + value } uses correct syntax with pipes and comma. Others have syntax errors or wrong block format.h.each { |key, value| puts key + value } [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions