Skip to content

Instantly share code, notes, and snippets.

@gugutz
Created January 2, 2018 23:15
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 gugutz/e57b67014c78c0dffb8f91ea66bb8fc9 to your computer and use it in GitHub Desktop.
Save gugutz/e57b67014c78c0dffb8f91ea66bb8fc9 to your computer and use it in GitHub Desktop.
Fizz Buzz em JavaScript
function fizzBuzz() {
var numero = 0;
for (numero == 0; numero < 101; numero++) {
if (numero % 5 == 0 && numero % 3 == 0) {
console.log("FizzBuzz");
continue;
}
else if (numero % 3 == 0) {
console.log("Fizz");
continue;
}
else if (numero % 5 == 0) {
console.log("Buzz");
continue;
}
else {
console.log(numero);
}
}
}
fizzBuzz();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment