Then We try to use that object as though it were a string. But calling length() on nil is not possible.
Tip Try changing the hash["b"] lookup to use instead the key "a". The program will proceed without an error. The key exists.
# An example hash.
hash = Hash["a" => "dog"]
# Get an element that does not exist.
v = hash["b"]
# We cannot use length on it.
puts v.length()...undefined method 'length' for nil:NilClass (NoMethodError)
Uninitialized fields. A field in a class is automatically set to nil before it is assigned a value. So we can check for nil to see if a field has been initialized yet.