Created
August 25, 2016 19:56
-
-
Save Riccardo-Zanutta/2705de6b9ee4eed1acbb601f43d8ed5e to your computer and use it in GitHub Desktop.
Non Mutating way to remove an element from an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove(array, element) { | |
return array.filter(e => e !== element); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment