Last active
August 29, 2015 14:02
-
-
Save cloneko/4d7f8db08c53c7485457 to your computer and use it in GitHub Desktop.
ふと思い付いた駄目な感じのfizzbuzz
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 end = 150; | |
for (var i = 0; i <= end;i++){ | |
console.log(function(){ | |
var ret = '' | |
// Fizz | |
ret += function(){ | |
return (i % 3) == 0 ? 'Fizz' : ''; | |
}(); | |
// Buzz | |
ret += function(){ | |
return (i % 5) == 0 ? 'Buzz' : ''; | |
}(); | |
return ret == '' ? i : ret; | |
}()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
node.jsで試した。