Tell us what’s happening:
Your code so far
// Creates an empty array to store our final result.
var arrayOfUniqueValues = arr1;
for(var i=0; i < arguments.length; i++){
for(var j=0; j < arguments[i].length; j++){
if(arrayOfUniqueValues.indexOf(arguments[i][j]) === -1){
arrayOfUniqueValues.push(arguments[i][j]);
}
}
}
return arrayOfUniqueValues;
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/sorted-union