Set a value in a Map or WeakMap, and return the value.
Commonly used with constructions like return map.get(key) ?? setMap(map, key, calculateDefault()).
return map.get(key) ?? setMap(map, key, calculateDefault())
The type of key accepted by the map
The type of value accepted by the map
Set a value in a Map or WeakMap, and return the value.
Commonly used with constructions like
return map.get(key) ?? setMap(map, key, calculateDefault())
.