Skip to content

Instantly share code, notes, and snippets.

@jamesnotjim
Created September 20, 2017 13:54
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 jamesnotjim/b922b7b0d71ac2344e8012093449cee8 to your computer and use it in GitHub Desktop.
Save jamesnotjim/b922b7b0d71ac2344e8012093449cee8 to your computer and use it in GitHub Desktop.
JS FizzBuzz
for (number = 1; number <= 100; number++) {
if (number % 3 == 0 && number % 5 == 0) {
console.log ("FizzBuzz");
} else if (number % 3 == 0) {
console.log ("Fizz");
} else if (number % 5 == 0) {
console.log ("Buzz");
} else {
console.log(number);
}
}
@jamesnotjim
Copy link
Author

jamesnotjim commented Sep 20, 2017

Nothing fancy, just a Fizz Buzz solution in JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment