Function ofArrayMutable

Returns a IMapOfMutableExtended to allow storing multiple values under a key, unlike a regular Map.

const map = ofArrayMutable();
map.addKeyedValues(`hello`, [1,2,3,4]); // Adds series of numbers under key `hello`

const hello = map.get(`hello`); // Get back values

Takes options:

A custom Util.ToString function can be provided as the convertToString opion. This is then used when checking value equality (has, without)

const map = ofArrayMutable({ convertToString:(v) => v.name}); // Compare values based on their `name` field;

Alternatively, a IsEqual function can be used:

const map = ofArrayMutable({comparer: (a, b) => a.name === b.name });