data_structures/hash_non_primitive_keys.rb
tests/_examples/data_structures/hash_non_primitive_keys.rb in the metorex repository.
a = [1, 2]
b = [3, 4]
h = {}
h[a] = "first"
h[b] = "second"
puts h[a]
puts h[b]
Output:
first
second
tests/_examples/data_structures/hash_non_primitive_keys.rb in the metorex repository.
a = [1, 2]
b = [3, 4]
h = {}
h[a] = "first"
h[b] = "second"
puts h[a]
puts h[b]
Output:
first
second