The type of the keys.
The type of the stored values.
The first value in insertion order, or null when the map is empty. Copied unless
enforceImmutability is false.
The last value in insertion order, or null when the map is empty. Copied unless
enforceImmutability is false.
Itself, allowing for method chaining.
Store a value at the given key. The value is copied first unless
enforceImmutability is false.
The key to read.
A copy of the stored value, or the value itself when
enforceImmutability is false. undefined if the key is not set.
A new array of the map's keys.
A new array of the map's values. The values themselves are not copied.
GradumMap
Description
A Map that hands out copies instead of references, so callers cannot mutate stored values by accident. It also adds array accessors and the usual
map/filter/mergehelpers, which return new maps rather than mutating this one. Set enforceImmutability tofalseto get plain reference semantics back.