1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| const a = [1,2,3]; const b = [1,5,6]; const c = a.concat(b);
const obj1 = { a:1, } const obj2 = { b:1, } const obj = Object.assign({}, obj1, obj2);
const a = [1,2,3]; const b = [1,5,6]; const c = [...new Set([...a,...b])];
const obj1 = { a:1, } const obj2 = { b:1, } const obj = {...obj1,...obj2};
|