let a = [34, 35, 45, 48, 49];
let b = [48, 55];
let union = [...new Set([...a, ...b])];
console.log(union);
var a = [34, 35, 45, 48, 49];
var b = [48, 55];
var union = [...new Set([...a, ...b])];
console.log(union);
// union of two arrays javascript (duplicate)
const union = (a, b) => Array.from(new Set([...a, ...b]));
console.log(union([1, 2, 3], [4, 3, 2]))
// output
// [1, 2, 3, 4]