Skip to content

Instantly share code, notes, and snippets.

@topicus
Last active October 31, 2015 16:53
Show Gist options
  • Save topicus/4001819427a2ddd3ef00 to your computer and use it in GitHub Desktop.
Save topicus/4001819427a2ddd3ef00 to your computer and use it in GitHub Desktop.
Scalable implementation of FizzBuzz problem
'use strict';
for(let i = 1; i <= 100; i++) {
let out = '';
if(i % 3 == 0) {
out = 'fizz';
}
if(i % 5 == 0) {
out += 'buzz';
}
if(!out) {
out = i
}
console.log(out);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment