Answers for "javascript add two arrays of dictionaries together without duplicates"

0

javascript merge two lists without duplicates

const array1 = ['a','b','c'];
const array2 = ['c','c','d','e'];
const array3 = [...new Set([...array1,...array2])];
console.log(array3); // ["a", "b", "c", "d", "e"]
Posted by: Guest on November-23-2021
0

merge 2 dictionaries with same keys javascript

const target = { a: [1], b: [2] };
const source = { a: [2], c: [5] };

const returnedTarget = Object.assign(target, source);

for(var date in source)
target[date] = [...target[date] || [],...source[date]]

console.log(target);
Posted by: Guest on September-13-2021

Code answers related to "javascript add two arrays of dictionaries together without duplicates"

Code answers related to "Javascript"

Browse Popular Code Answers by Language