Adds one or more items, returning the changed map.
Can add items in the form of [key,value]
or {key, value}
.
Returns an empty map
Deletes an item by key, returning the changed map
Returns true if map contains key
Sets key
to be value
, overwriting anything existing.
Returns a new map with added key.
An immutable map. Rather than changing the map, functions like
add
anddelete
return a new map reference which must be captured.Immutable data is useful because as it gets passed around your code, it never changes from underneath you. You have what you have.
Example