RosettaCodeData/Task/Associative-array-Creation/Ruby/associative-array-creation-6.rb

5 lines
105 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
hash = Hash.new('unknown key')
hash[666] = 'devil'
hash[777] # => 'unknown key'
hash[666] # => 'devil'