Last active
December 5, 2015 19:26
-
-
Save justincorrigible/aa9cc837d6eb764d6116 to your computer and use it in GitHub Desktop.
A quick and dirty FizzBuzz attempt... just in case I ever need it.
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 fzbz = Array .apply(null, { length: 101 }) | |
.map(Number.call, Number) | |
.map(obj => obj % 3 === 0 && obj % 5 === 0 ? | |
'fizzbuzz' : obj % 3 === 0 ? | |
'fizz' : obj % 5 === 0 ? | |
'buzz' : obj); | |
fzbz.shift(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”."