- computeIfAbsent<K, V>(map: Map<K, V>): ((key: K, mappingFunction: Mapper<K, V>) => undefined | V)
-
Returns ((key: K, mappingFunction: Mapper<K, V>) => undefined | V)
-
- (key: K, mappingFunction: Mapper<K, V>): undefined | V
-
Parameters
-
key: K
-
mappingFunction: Mapper<K, V>
Returns undefined | V
Mutation
Remark
only returns
undefinedifmappingFunctionreturnsundefinedExample
Set a Map entry if the key is absent