Skip to content

Instantly share code, notes, and snippets.

@hakimelek
Created May 16, 2018 06:22
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 hakimelek/e0ad6fa3f70e11d54e42b8163f73e533 to your computer and use it in GitHub Desktop.
Save hakimelek/e0ad6fa3f70e11d54e42b8163f73e533 to your computer and use it in GitHub Desktop.
CracklePop
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