Skip to content

Instantly share code, notes, and snippets.

@Xilesun
Last active January 4, 2023 06:42
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 Xilesun/537bd4e5073cf30d031e9e089b7a855c to your computer and use it in GitHub Desktop.
Save Xilesun/537bd4e5073cf30d031e9e089b7a855c to your computer and use it in GitHub Desktop.
(function CracklePop() {
for (let i = 1; i <= 100; i++) {
const div3 = i % 3;
const div5 = i % 5;
if (div3 === 0 && div5 === 0) {
console.log('CracklePop');
} else if (div3 === 0) {
console.log('Crackle');
} else if (div5 === 0) {
console.log('Pop');
} else {
console.log(i);
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment