Create empty hash



examples/hashes/empty_hash_of_strings.cr
phone_of = {} of String => String
puts phone_of.empty?

phone_of["Jane"] = "123"
phone_of["Jack"] = "456"

# phone_of["Narnia"] = 42
# Error: no overload matches 'Hash(String, String)#[]=' with types String, Int32

puts phone_of
puts phone_of.empty?

examples/hashes/empty_hash_string_int32.cr
phone_of = {} of String => String | Int32
phone_of["Jane"] = "123"
phone_of["Jack"] = "456"

phone_of["Narnia"] = 42

# phone_of["is_it_true?"] = true
# Error: no overload matches 'Hash(String, Int32 | String)#[]=' with types String, Bool

puts phone_of

examples/hashes/empty_hash_string_int32_bool.cr
phone_of = {} of String => String | Int32 | Bool
phone_of["Jane"] = "123"
phone_of["Jack"] = "456"

phone_of["Narnia"] = 42

phone_of["is_it_true?"] = true

puts phone_of