Tell us what’s happening:
I am trying to use the new ES6 Set() to filter the array but it doesn’t seem to work with variables. If I enter the array manually it works as expected.
Your code so far
function uniteUnique(...arr) {
console.log(arr)
let uniq = [...new Set(arr)]
console.log(uniq)
return uniq;
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/sorted-union/