add method

void add(
  1. T item
)

Adds an item to the end of this list.

This has constant time complexity.

Implementation

void add(T item) {
  _map[item] = (_map[item] ?? 0) + 1;
}