Last active
December 17, 2015 17:59
-
-
Save danprince/5649923 to your computer and use it in GitHub Desktop.
Functionless 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
f={set b(l){ | |
m=function(a,b){while(a>b){a-=b}r=--a} | |
i=1 | |
while(i<=l){ | |
a=i++ | |
m(i,3) | |
r?0:a+="fizz" | |
m(i,5) | |
r?0:a+="buzz" | |
console.log(a) | |
}}} | |
// call with f.b = 10 | |
// to get fizzbuzz to 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment