Last active
December 31, 2015 22:49
-
-
Save mathiasverraes/8055593 to your computer and use it in GitHub Desktop.
fizzbuzz in javascript with and without lodash (probably works with underscore as well)
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
for(i=0;i<100;console.log(++i%15?i%5?i%3?i:f='Fizz':b='Buzz':f+b)); |
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
_.range(1,101).map(function(i){return i%15?i%5?i%3?i:'Fizz':'Buzz':'FizzBuzz'}) |
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(){var j=[];for(i=0;i<100;j.push(++i));return j})().map(function(i){return i%15?i%5?i%3?i:'Fizz':'Buzz':'FizzBuzz'}) |
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
for(i=0;i<100;console.log(++i%15?i%5?i%3?i:'Fizz':'Buzz':'FizzBuzz')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment