Adds an element with a specified key
and value
to this Map.
If the key
already exists, the value will be replaced.
If you wish to add multiple elements in a single call, use the setAll
method instead.
name | type | description |
---|---|---|
key | string |
The key of the element to be added to this Map. |
value | * |
The value of the element to be added to this Map. |
This Map object.