Optiosn for mutable array
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:
comparer
: IsEqualtoString
: Util.ToStringA 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 });
Returns a IMapOfMutableExtended to allow storing multiple values under a key, unlike a regular Map.