Skip to content

Instantly share code, notes, and snippets.

@MelodicCrypter
Created April 25, 2019 15:17
Show Gist options
  • Save MelodicCrypter/9f6021db6f115af4a6d31965db0339e7 to your computer and use it in GitHub Desktop.
Save MelodicCrypter/9f6021db6f115af4a6d31965db0339e7 to your computer and use it in GitHub Desktop.
Clean FizzBuzz code.
for (let i = 1; i < 100; i++) {
let res = '';
if (i % 3 === 0) { res += 'Fizz'; }
if (i % 5 === 0) { res += 'Buzz'; }
if (res === '') { res = i; }
console.log(res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment