Skip to content

Instantly share code, notes, and snippets.

@jorlee92
Created July 2, 2017 04:29
Show Gist options
  • Save jorlee92/4237149de8c336c0f90f6de03d66d2d6 to your computer and use it in GitHub Desktop.
Save jorlee92/4237149de8c336c0f90f6de03d66d2d6 to your computer and use it in GitHub Desktop.
function destroyer(arr) {
// Remove all the values
res = Array.from(arr[0]);
for(var i = 1 ; i < arr.length; i++){
res = res.filter(function(v){
console.log(i);
console.log(v);
return v!=arr[i];
});
}
return res;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment