-
-
Save satokitty/3305435 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
// 指定した値まで表示するように変更 | |
// fizzbuzz(15) -> 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz | |
fizz = function f() { | |
fizz = function() { | |
fizz = function() { | |
fizz = f | |
return "Fizz" | |
} | |
} | |
} | |
buzz = function f() { | |
buzz = function() { | |
buzz = function() { | |
buzz = function () { | |
buzz = function () { | |
buzz = f | |
return "Buzz" | |
} | |
} | |
} | |
} | |
} | |
fizzbuzz = function(n) { | |
n == 1 || fizzbuzz(n-1) | |
console.log((fizz() || "") + (buzz() || "") || n) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment