set
Assigns new key-value pairs to a map object
(set keyValuePairs obj)
Returns
The set
function returns a new map object with the updated key-value pairs. The original map object remains unchanged
Parameters
keyValuePairs (object) - an object containing the key-value pairs to be added or modified in the map
obj (object) - the target map object to which the key-value pairs will be assigned.
Examples
(def obj1 {age: 22})
(set {height: 100} obj1)
;;=> {age: 22, height: 100}
obj1 ;; obj remains unchange
;;=> {age: 22}
Was this helpful?