Skip to content

Instantly share code, notes, and snippets.

@aadilayub
Created July 25, 2018 12:57
Show Gist options
  • Save aadilayub/8fd789677fd549bdc3de0b6b6450db89 to your computer and use it in GitHub Desktop.
Save aadilayub/8fd789677fd549bdc3de0b6b6450db89 to your computer and use it in GitHub Desktop.
var removeFromArray = function (array, element) {
var elementToBeDeleted;
for (var i = 1; i < arguments.length; i++) {
elementToBeDeleted = arguments[i];
for (var j = 0; j < array.length; j++) {
if (array[j] == elementToBeDeleted) {
array.splice(i,1);
}
}
}
return array;
}
module.exports = removeFromArray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment