Skip to content

Instantly share code, notes, and snippets.

@RoseCrime
Created May 20, 2018 16:03
Show Gist options
  • Save RoseCrime/85d379319b5af7a6fcd4d626554cc59c to your computer and use it in GitHub Desktop.
Save RoseCrime/85d379319b5af7a6fcd4d626554cc59c to your computer and use it in GitHub Desktop.
Filter method
let vals = [1, 3, 65, 7, 3, 2, 6, 75, 3, 42, 12, 312, 23]
vals = vals.filter(num =>!(num % 2))
/*vals = vals.filter(num =>num % 2 == 0)*/
//same thing
console.log(vals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment