Created
May 15, 2012 00:40
-
-
Save battlejj/2698295 to your computer and use it in GitHub Desktop.
Fizz Buzz
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(x = 1; x <= 100; x++){ | |
var temp = [x, 'fizz', 'buzz', 'fizzbuzz']; | |
var pos = 0; | |
if(x%3 == 0){ | |
pos += 1; | |
} | |
if(x%5 == 0){ | |
pos += 2; | |
} | |
console.log(temp[pos]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment