Skip to content

Instantly share code, notes, and snippets.

@iRoachie
Last active October 28, 2016 19:01
Show Gist options
  • Save iRoachie/304d1a713c466224461686baff1b41a5 to your computer and use it in GitHub Desktop.
Save iRoachie/304d1a713c466224461686baff1b41a5 to your computer and use it in GitHub Desktop.
Even, Odd Numbers
const numbers = [12, 37, 5, 42, 8, 3];
let even = [];
let odd = [];
numbers.map(number => {
if(number % 2 === 0) {
even.push(number);
} else {
odd.push(number);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment