Adds a value to the array for a key in a Map-backed multimap.
Map
Creates the array if the key doesn't exist.
Key type.
Value type.
The multimap.
The key.
The value to add.
The array for key k (same reference).
k
const mm = new Map<string, number[]>();multimapAdd(mm, "a", 1);multimapAdd(mm, "a", 2);mm.get("a"); // [1, 2] Copy
const mm = new Map<string, number[]>();multimapAdd(mm, "a", 1);multimapAdd(mm, "a", 2);mm.get("a"); // [1, 2]
Adds a value to the array for a key in a Record-backed multimap.
Record
Key type (must be PropertyKey).
PropertyKey
Adds a value to the array for a key in a
Map-backed multimap.Creates the array if the key doesn't exist.