Returns the index for the given key.
The key to find in the dictionary.
The index for
key and its associated value if
key is in the dictionary; otherwise,
If the given key is found in the dictionary, this method returns an index into the dictionary that corresponds with the key-value pair.
Accessing Keys and Values
subscript(Key, default: () -> Value) -> Value
Accesses the value with the given key. If the dictionary doesn’t contain the given key, accesses the provided default value as if the key and default value existed in the dictionary.