Created
March 4, 2014 00:02
-
-
Save arayi/9337355 to your computer and use it in GitHub Desktop.
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
var fizzBuzz = function(max) { | |
if (max == 2) { return "Shiny JS Recursive FizzBuzz! :D\n" } | |
else if (max % 15 === 0) { return fizzBuzz(max - 1) + "\nFizzBuzz" } | |
else if (max % 5 === 0) { return fizzBuzz(max - 1) + "\nBuzz" } | |
else if (max % 3 === 0) { return fizzBuzz(max - 1) + "\nFizz" } | |
else { return fizzBuzz(max-1) + "\n" + max.toString() } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment