Seek and Destroy what's the problem?

Seek and Destroy what's the problem?
0

#1

What is the problem with my cycles?
Here is my code:

function destroyer(arr) {
// Remove all the values
var i;
var x;
function diferentes(val){
for(var z=0;z<arr[0].length;z++){
if(arr[0]==arr[z])
return val;
}
}

var sliced=arr.filter(diferentes);
for(i=0;i<arr.length;i++){
for(x=0;x<arr[0].length;x++){
if (arr[0][x]!==arr[i][x]){
return sliced;
}
}
}
}

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


#2

Array.prototype.filter() requires a callback function that returns a boolean value. Your diferentes function does not do that.