Ruby - Hashes
Find the problem in this code:
h = {a: {b: 2}}
puts h.dig(:a, :b, :c)h = {a: {b: 2}}
puts h.dig(:a, :b, :c):b has value 2, which is an integer, not a hash.dig(:c) on integer 2 causes a NoMethodError.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions