clear method

void clear()

Removes all entries from the map.

Time complexity: O(n) where n is the number of entries

Example:

map.set('a', 1);
map.set('b', 2);
map.clear();
print(map.length); // 0

Implementation

void clear() {
  _values.clear();
  _keyToIndex.clear();
}