Created
April 23, 2015 18:39
-
-
Save wanooknox/32ab027e276dd0c34953 to your computer and use it in GitHub Desktop.
A FizzBuzz paradise. More variants to come.
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 = 0; i < 100; i++) | |
{ | |
var test = ""; | |
if (i % 3 == 0) //multiple of 3 | |
{ test += "fizz"; } | |
if (i % 5 == 0) //multiple of 5 | |
{ test += "buzz"; } | |
if (test == "") //no multiple | |
{ test = i; } | |
document.write(test + "<br \>"); //print | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment