Created
September 21, 2015 17:34
-
-
Save jheth/6f22df7d1cd14f724d05 to your computer and use it in GitHub Desktop.
Javascript 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 (i = 1; i <= 100; i++) { | |
var f = (i % 3 == 0); | |
var b = (i % 5 == 0); | |
if (f && b) { | |
console.log('fizzbuzz', i); | |
} else if (f) { | |
console.log('fizz', i); | |
} else if (b) { | |
console.log('buzz', i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment