DEV Community

Discussion on: Solving "Sorted Union" / freeCodeCamp Algorithm Challenges

Collapse
 
abhishek_san profile image
Abhishek Prasad

i have tried something more simple you can see below....

function uniteUnique(arr) {
let array = [].concat.apply([], [...arguments])

return Array.from(new Set(array));
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);