Tell us what’s happening:
Can’t get filtered array - maybe smth wrong with parameters
Your code so far
function uniteUnique(arr, ...restArr) {
let arno = arr;
let rear = restArr[0].concat(restArr[1]);//rests in one-dimensional array
function check(arno, rear) {//filter items which are not in first array
return rear.filter(item => arno.includes(item));
}
let narr = arno.concat(rear);//merge first array and filtered second array
return narr;
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) 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