We could do this:
{ ...{ x: 1 }, y: 2, z: 3 }
if we knew for sure that the argument map was a JS object.
dissoc:
(({ key1, key2, ...rest }) => rest)(obj)
get with default:
Of course you could shrink the size of the above by calling rest some single char thing
(conj ^array x b c) => […x, b, c]
For Map:
const m2 = new Map([...m1, ['x', 10], ['y', 20]]);
Would be worth checking if this is any faster than a function in which we do this only for objects
We could do this:
if we knew for sure that the argument map was a JS object.
dissoc:getwith default:Of course you could shrink the size of the above by calling
restsome single char thingFor Map:
Would be worth checking if this is any faster than a function in which we do this only for objects
contains? -> "key" in object
doto -> comma expression