Created
May 16, 2018 06:22
-
-
Save hakimelek/e0ad6fa3f70e11d54e42b8163f73e533 to your computer and use it in GitHub Desktop.
CracklePop
This file contains hidden or 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
Array(100) | |
.fill(0) | |
.map((a, i) => i+1) | |
.forEach(num => { | |
if (num % 3 === 0 && num % 5 === 0) return console.log('CracklePop') | |
else if (num % 3 === 0) return console.log('Crackle') | |
else if (num % 5 === 0) return console.log('Pop') | |
return console.log(num) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment