new Map()
Describe a Map.
- Source:
- To Do:
-
- be carreful with 'key' which can be a keyword as "length" !
Members
(static, readonly) size :number
Get the size of the Map.
Type:
- number
- Source:
Methods
(static) clear()
Clear the Map object.
- Source:
(static) delete(key) → {number|undefined}
Delete an element into the Map.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to search for. |
- Source:
Returns:
The size of the Map.
- Type
- number | undefined
(static) entries() → {Array}
The whole content of the Map.
- Source:
Returns:
The complete key-value list of the Map.
- Type
- Array
(static) get(key) → {?}
Get an element of the Map.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to search for. |
- Source:
Returns:
The item linked to the key.
- Type
- ?
(static) has(key) → {boolean}
Has an element into the Map?
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to search for. |
- Source:
Returns:
Returns true if an item corresponding to the key is found, if not, returns false.
- Type
- boolean
(static) keys() → {Array.<String>}
The list of the keys.
- Source:
Returns:
The list of all the Map keys.
- Type
- Array.<String>
(static) set(key, item) → {number|undefined}
Set an element into the Map.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to assign. |
item |
? | The item to add. |
- Source:
Returns:
The size of the Map.
- Type
- number | undefined
(static) values() → {Array.<?>}
The list of the values.
- Source:
Returns:
The list of all the Map values.
- Type
- Array.<?>