Skip to content

Instantly share code, notes, and snippets.

@ethanstenis
Created July 13, 2017 18:03
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 ethanstenis/865df4ba179fd114fb25f6a0ed93bbbf to your computer and use it in GitHub Desktop.
Save ethanstenis/865df4ba179fd114fb25f6a0ed93bbbf to your computer and use it in GitHub Desktop.
This is the solution for the Odds/Even/Prime Number Kata
function oddEven() {
for(let i = 1; i <= 100; i++) {
if(i % 2 === 0) {
console.log('Even');
} else if (i % 2 !== 0 && i % 3 === 0 || i % 9 === 0 || i % 5 === 0){
console.log('Odd');
} else {
console.log(i);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment