Created
December 31, 2018 21:54
-
-
Save alessbell/62b8d6fe73a6379f8545f5f023880d12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cracklepop.js | |
let message; | |
const arr = [...Array(101).keys()]; | |
arr.shift(); | |
arr.forEach((num) => { | |
if (!(num % 3) && !(num % 5)) { | |
message = 'CracklePop'; | |
} else if (!(num % 3)) { | |
message = 'Crackle'; | |
} else if (!(num % 5)) { | |
message = 'Pop'; | |
} else { | |
message = num; | |
} | |
console.log(message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment