setMapItem()function
setMapItem(map: MutableMap<K, T>, key: K, value: T): T
| Param | Type | |
|---|---|---|
map | MutableMap<K, T> | The mutable map to set the item on. required |
key | K | The key to set. required |
value | T | The value to set. required |
| Return | |
|---|---|
T | The value that was set. |
Set an item in a map (by reference) and return the value that was set.
Examples
setMapItem(map, "a", 1) // 1