Skip to content

Instantly share code, notes, and snippets.

@alvaro-prieto
Created October 4, 2017 08:15
Show Gist options
  • Save alvaro-prieto/bcd235fb49773b6bda01331b3f59cc22 to your computer and use it in GitHub Desktop.
Save alvaro-prieto/bcd235fb49773b6bda01331b3f59cc22 to your computer and use it in GitHub Desktop.
//Permite obtener un subset de un array con los elementos que cumplen con una
//condición, por ejemplo los impares:
var filtrado = [1,2,3,4,5,6,7,8].filter( x => x % 2 ); //[1, 3, 5, 7]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment