To add a key-value pair to a Map,
we can use the set
method.
In the example given above,
we have a map mapWithRandomProps
.
mapWithRandomProps.set([ 1, 2, 3, 4 ], "Property with array key")
added a new property to the map
with the key [ 1, 2, 3, 4 ]
and the value "Property with array key"
.