Created
March 22, 2016 14:47
-
-
Save mindplace/d05b280f97286e327f8c to your computer and use it in GitHub Desktop.
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
| function fizzBuzz(max) { | |
| for (var num=1; num <= max; num++) { | |
| var current = ""; | |
| if (num % 3 == 0) { | |
| current += "Fizz"; | |
| } | |
| if (num % 5 == 0) { | |
| current += "Buzz"; | |
| } | |
| if (!(current)) { | |
| current += num.toString(); | |
| } | |
| console.log(current); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment