Skip to content

Instantly share code, notes, and snippets.

@techsin
Created June 14, 2017 09:39
Show Gist options
  • Save techsin/27eb268e008dffdc00d1bf609e5fda6d to your computer and use it in GitHub Desktop.
Save techsin/27eb268e008dffdc00d1bf609e5fda6d to your computer and use it in GitHub Desktop.
var max = 20;
var i = 0;
var word;
while (i++ < max) {
if (i % 3 == 0) {
word = 'Fizz';
if (i % 5 == 0) {
word += 'Buzz';
}
} else if (i % 5 == 0) {
word = 'Buzz';
} else {
word = i;
}
console.log(word);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment