Skip to content

Instantly share code, notes, and snippets.

@marcusellis05
Last active August 29, 2015 14:21
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 marcusellis05/0393db956e9401f53844 to your computer and use it in GitHub Desktop.
Save marcusellis05/0393db956e9401f53844 to your computer and use it in GitHub Desktop.
FizzBuzz
function fizzbuzz(limit){
var fb;
for (var i=1; i<=limit; i++){
fb = '';
if (i % 3 === 0){
fb += 'Fizz';
}
if (i % 5 === 0){
fb += 'Buzz';
}
if (!fb){
fb = i;
}
console.log(fb);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment