True if the provided value is a Map
const { Map } = require('immutable')
Map.isMap({}) // false
Map.isMap(Map()) // true
Creates a new Map from alternating keys and values
const { Map } = require('immutable')
Map.of(
'key', 'value',
'numerical value', 3,
0, 'numerical key'
)
// Map { 0: "numerical key", "key": "value", "numerical value": 3 }
Generated using TypeDoc
Immutable Map is an unordered Collection.Keyed of (key, value) pairs with
O(log32 N)
gets andO(log32 N)
persistent sets.Iteration order of a Map is undefined, however is stable. Multiple iterations of the same Map will iterate in the same order.
Map's keys can be of any type, and use
Immutable.is
to determine key equality. This allows the use of any value (including NaN) as a key.Because
Immutable.is
returns equality based on value semantics, and Immutable collections are treated as values, any Immutable collection may be used as a key.Any JavaScript object may be used as a key, however strict identity is used to evaluate key equality. Two similar looking objects will represent two different keys.
Implemented by a hash-array mapped trie.