Help with seek and destroy algorithm[Solved]

Help with seek and destroy algorithm[Solved]
0.0 0

#1

function destroyer(arr) {
// Remove all the values
var args = Array.prototype.slice.call(arguments,1);
var result = arr.filter(function (value,index,array) {
for(var i = 1; i < args.length; i++) {
if(value != args[i]) {
return true;
} else {
return false;
}
}
});
return result;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

I so far have this how can I use return without breaking the loop, I have already solved this but the solution I have is poorly writen and designed.

My solution, it passed the tests but it’s not very good solution.


#3

Thank you so much, it was all so simple all along. :sweat_smile: