Sorted Union- includes not working as expected

Tell us what’s happening:
what’s wrong with line 9 “includes not working as expected”

Your code so far


function uniteUnique(arr) {
 let newarr = [];
 for(let i=0;i<arguments.length;i++){
  // console.log(arguments[i])
   newarr.push(
     arguments[i].map(element=>{
       //console.log(element);
         //debugger;
         if(!newarr.includes(element)){
            return element;    
         }
         
     })
   ); 
 }
 
  return newarr;
}
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/70.0.3538.77 Safari/537.36.

Link to the challenge:

Its not to do with includes — thats fine. The issue is that map is not for filtering, filter is for filtering. And if you use filter, you don’t need the loop or push, and vice versa.