main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function destroyer(arr) {
  
  return arr.filter(function(a){
    var matched = 0;
    
    for (var i = 1; i < destroyer.arguments.length; i++){
      if (a == destroyer.arguments[i]) {
        matched++;
      }
    }
    
    if (matched === 0) {
      return true;
    }
    
    return false;
  });
  
    
}

console.log(destroyer([1, 2, 3, 1, 2, 3], 2, 3));
console.log(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3));
console.log(destroyer([3, 5, 1, 2, 2], 2, 3, 5));
console.log(destroyer([2, 3, 2, 3], 2, 3));
console.log(destroyer(["tree", "hamburger", 53], "tree", 53));
Native Browser JavaScript