Skip to content

Instantly share code, notes, and snippets.

@methodin
Created December 28, 2011 03:08
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 methodin/1525979 to your computer and use it in GitHub Desktop.
Save methodin/1525979 to your computer and use it in GitHub Desktop.
Fizz Buzz
var str = '';
for(var i=1;i<=100;i++) {
var rep = '';
if(i % 3 == 0) rep = 'Fizz';
if(i % 5 == 0) rep += 'Buzz';
str += (rep||i)+', ';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment