Created
January 2, 2019 19:27
-
-
Save emeaguiar/2a00b05439483c804975d4176856345e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const array = [ 'foo', 'bar', 'baz' ]; | |
// Regresa todo lo que no es "bar" | |
const newArray = array.filter( element => element !== 'bar' ); | |
// [ 'foo', 'baz' ] | |
console.log( newArray ); | |
// [ 'foo', 'bar', 'baz' ] | |
console.log( array ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment