Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update a certain key in dictionary javascript

const target = {c: 4, d: 5}
const source = {a: 1, b: 2, c: 3};

const newObj = Object.assign({}, target, source);

console.log(newObj); //=> {a: 1, b: 2, c: 3, d: 5}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #update #key #dictionary #javascript
ADD COMMENT
Topic
Name
2+7 =