Skip to content

Instantly share code, notes, and snippets.

@htkcodes
Last active November 22, 2017 21:28
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 htkcodes/798f8d0eab8467d0af13e7c1b6bb5e29 to your computer and use it in GitHub Desktop.
Save htkcodes/798f8d0eab8467d0af13e7c1b6bb5e29 to your computer and use it in GitHub Desktop.
fizz(500);
function fizz(num) {
for(let z=1; z<num;z++)
{
if(z%15 ===0) console.log('FizzBuzz');
else if (z%3 ===0) console.log('Fizz');
else if(z%5 ===0) console.log('Buzz');
else
console.log(z);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment