Tell us what’s happening:
I have checked my code using my own editor and it returns all arrays as it is supposed to yet FCC interface tells me I am not returning the correct values. I have also double checked if the the returned value is an array.
Your code so far
function uniteUnique(arr) {
let newArr=[];
for (let i = 0; i < arr.length; i++) {
for(let j=0; j<arr[i].length;j++)
{
if(newArr.includes(arr[i][j])===false){
newArr.push(arr[i][j]);
}
}
}
return newArr;
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.
Challenge: Sorted Union
Link to the challenge: