Function deleteByValue

Deletes all key/values from map where value matches value, with optional comparer. Mutates map.

import { Maps } from "https://unpkg.com/ixfx/dist/collections.js"

// Compare fruits based on their colour property
const colourComparer = (a, b) => a.colour === b.colour;

// Deletes all values where .colour = `red`
Maps.deleteByValue(map, { colour: `red` }, colourComparer);
  • Type Parameters

    • K
    • V

    Parameters

    • map: ReadonlyMap<K, V>
    • value: V
    • comparer: IsEqual<V> = isEqualDefault

    Returns void