Skip to content

Instantly share code, notes, and snippets.

@emeaguiar
Created January 2, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emeaguiar/2a00b05439483c804975d4176856345e to your computer and use it in GitHub Desktop.
Save emeaguiar/2a00b05439483c804975d4176856345e to your computer and use it in GitHub Desktop.
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