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 Copy
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
toString
A custom Util.ToString function can be provided as the convertToString opion. This is then used when checking value equality (has, without)
convertToString
has
without
const map = ofArrayMutable({ convertToString:(v) => v.name}); // Compare values based on their `name` field; Copy
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 }); Copy
const map = ofArrayMutable({comparer: (a, b) => a.name === b.name });
Data type of items
Optiosn for mutable array
IMapOfMutableExtended
Returns a IMapOfMutableExtended to allow storing multiple values under a key, unlike a regular Map.
Example
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
)Alternatively, a IsEqual function can be used: