Creates a new Immutable Map.
Created with the same key value pairs as the provided Iterable.Keyed or JavaScript Object or expects an Iterable of [K, V] tuple entries.
var newMap = Map({key: "value"});
var newMap = Map([["key", "value"]]);
Keep in mind, when using JS objects to construct Immutable Maps, that JavaScript Object properties are always strings, even if written in a quote-less shorthand, while Immutable Maps accept keys of any type.
var obj = { 1: "one" };
Object.keys(obj); // [ "1" ]
obj["1"]; // "one"
obj[1]; // "one"
var map = Map(obj);
map.get("1"); // "one"
map.get(1); // undefined
Property access for JavaScript Objects first converts the key to a string,
but since Immutable Map keys can be of any type the argument to get()
is
not altered.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with
O(log32 N)
gets and O(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.
Map().set(List.of(1), 'listofone').get(List.of(1));
// 'listofone'
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.
True if the provided value is a Map
Creates a new Map from alternating keys and values
Generated using TypeDoc
Immutable Map is an unordered Iterable.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.Map().set(List.of(1), 'listofone').get(List.of(1)); // 'listofone'
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.