Created
February 17, 2016 21:38
-
-
Save mejiaro/d92f060e2cc7387af58c to your computer and use it in GitHub Desktop.
JS FizzBuzz
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
for (number = 1; number < 101; number++) | |
switch(true) { | |
case number % 3 == 0 && number % 5 == 0: | |
console.log("FizzBuzz"); | |
break; | |
case number % 3 == 0: | |
console.log("Fizz"); | |
break; | |
case number % 5 == 0: | |
console.log("Buzz"); | |
break; | |
default: | |
console.log(number) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment