Created
April 27, 2015 05:50
-
-
Save teckliew/19c8443c7c28b59300d0 to your computer and use it in GitHub Desktop.
My first JS FizzBuzz (to 100).
This file contains hidden or 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
var x = 0, num = 0; | |
while (x<100){ | |
num++; | |
if((num%3) === 0 && (num%5) !== 0 ){ | |
console.log("Fizz"); | |
}else if((num%3) !== 0 && (num%5) === 0){ | |
console.log("Buzz"); | |
}else if((num%3) === 0 && (num%5) === 0){ | |
console.log("FizzBuzz"); | |
}else{ | |
console.log(num); | |
} | |
x++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment