Adds a value to a multimap (Map with Array values)
Creates a new array for the key if it doesn't exist, or adds the value to the existing array if the value isn't already present.
The multimap to modify
The key to add the value under
The value to add
const filters = new Map();addValueToMultimap(filters, listFilter.tags, "Dessert");addValueToMultimap(filters, listFilter.tags, "Quick"); Copy
const filters = new Map();addValueToMultimap(filters, listFilter.tags, "Dessert");addValueToMultimap(filters, listFilter.tags, "Quick");
Adds a value to a multimap (Map with Array values)
Creates a new array for the key if it doesn't exist, or adds the value to the existing array if the value isn't already present.