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.