Tell us what’s happening:
My test returning failed even if its working! can you help me with this?
Your code so far
function uniteUnique(...args){
let result = [];
for(const arg of args){
let i = 0;
while(i<arg.length)
{
if(result.includes(arg[i])){
i++;
}
else{
result.push(arg[i]);
i++;
}
}
}
return console.log(result);
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
uniteUnique([1, 2, 3], [5, 2, 1]);
uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]);
uniteUnique([1, 3, 2], [5, 4], [5, 6]);
uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Challenge Information:
Implement a Unique Sorted Union - Implement a Unique Sorted Union