Skip to content

insert

insert<K, V>(key, value): (m) => ReadonlyMap<K, V>

Defined in: Utils/Dict.ts:186

Returns a new dictionary with the given key set to the given value. If the key already exists, its value is replaced.

K

V

K

V

(m): ReadonlyMap<K, V>

ReadonlyMap<K, V>

ReadonlyMap<K, V>

pipe(Dict.fromEntries([["a", 1]]), Dict.insert("b", 2));
// ReadonlyMap { "a" => 1, "b" => 2 }