Skip to content

Instantly share code, notes, and snippets.

@ayoung
Created February 20, 2013 07:06
Show Gist options
  • Save ayoung/4993561 to your computer and use it in GitHub Desktop.
Save ayoung/4993561 to your computer and use it in GitHub Desktop.
FizzBuzz
for (var i = 0; i <= 100; i++) {
if((i % 3) === 0 && (i % 5) === 0) {
console.log(i + ": fizzbuzz");
}
else if((i % 3) === 0) {
console.log(i + ": fizz");
}
else if((i % 5) === 0) {
console.log(i + ": buzz");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment