update a certain key in dictionary javascript

Solutions on MaxInterview for update a certain key in dictionary javascript by the best coders in the world

showing results for - "update a certain key in dictionary javascript"
Eve
23 Jun 2020
1const target = {c: 4, d: 5}
2const source = {a: 1, b: 2, c: 3};
3
4const newObj = Object.assign({}, target, source);
5
6console.log(newObj); //=> {a: 1, b: 2, c: 3, d: 5}