Add the value to the Map if it doesn't already have an entry with the same key
Set a Map entry if the key is absent
const map = new Map();setIfAbsent(map, 1, 2);console.log(map); // Map([[1, 2]])
the Map key type
the Map value type
the Map to set the entry
Generated using TypeDoc
Add the value to the Map if it doesn't already have an entry with the same key
Mutation
Example
Set a Map entry if the key is absent