I have tried the below code, but I am not getting satisfactory results.
function destroyer(arr) {
// Remove all the values
var newArray = arr.filter(function(x){
if(x == arr[0]){
return x;
}
});
return newArray;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);