operator [] method

Object? operator [](
  1. Object key
)
Gets or sets the element with the specified key. The key of the element to get or set.

Implementation

Object? operator [](Object key) {
  if (!_dictionary.containsKey(key)) {
    // C# Dictionary indexer throws KeyNotFoundException.
    throw ArgumentError.value(key, "key", "The given key was not present");
  }
  return _dictionary[key];
}