Closed UziTech closed 4 years ago
.set
does not provide a facility to differentiate how to produce the value for addition vs for updates; upsert
does.
I see, so the important part is running a given function that sets a key
based on the current value
(or lack there of) of the key
.
According to MDN Map.prototype.set():
So both will insert a
value
atkey
if it doesn't exist and update thevalue
atkey
if it does exist?