Skip to content

Instantly share code, notes, and snippets.

@calevano
Created May 16, 2018 16:44
Show Gist options
  • Save calevano/12d34c4a7f9498471d4aae3d7a640df1 to your computer and use it in GitHub Desktop.
Save calevano/12d34c4a7f9498471d4aae3d7a640df1 to your computer and use it in GitHub Desktop.
function to remove index in array
function remove(array, element) {
const index = array.indexOf(element);
if (index !== -1) {
array.splice(index, 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment