Alpha
Alpha
Create a new DefaultMap
with a specified default value.
Time complexity: O(n)
Space complexity: O(n)
The default value to use for missing keys
Optional
entries: null | Iterable<readonly [unknown, unknown]>Alpha
Create a new DefaultMap
with a specified function to generate default values.
Time complexity: O(n)
Space complexity: O(n)
Readonly
Alpha
[toReadonly
Alpha
sizeStatic
Readonly
Alpha
[species]Alpha
Add an addend to the value for a given key.
The key to update the value of
The value to add to the current value
The updated value
Alpha
true if an element in the Map existed and has been removed, or false if the element does not exist.
Alpha
Divide the value for a given key by a divisor.
The key to update the value of
The value to divide the current value by
The updated value
Alpha
Get the value for a given key, or the default value if it's missing.
Time complexity: O(1)
Space complexity: O(1)
The key to get the value for
The value for key
, or the default value if it's missing
Alpha
boolean indicating whether an element with the specified key exists or not.
Alpha
Multiply a multiplicand by the value for a given key.
The key to update the value of
The value to multiply the current value by
The updated value
Alpha
Raise the value for a given key to an exponent.
The key to update the value of
The exponent to raise the current value to
The updated value
Alpha
Take the _n_th root of the value for a given key.
The key to get the _n_th root of
The root to get
The nth root of the value for key
Alpha
Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Alpha
Square root of the value for a given key.
The key to get the square root of
The square root of the value for key
Alpha
Subtract a subtrahend from the value for a given key.
The key to update the value of
The value to subtract from the current value
The updated value
A DefaultMap with methods for performing basic math operations that mutate the data.