Created
January 2, 2018 23:15
-
-
Save gugutz/e57b67014c78c0dffb8f91ea66bb8fc9 to your computer and use it in GitHub Desktop.
Fizz Buzz em JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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