Last active
August 29, 2015 14:04
-
-
Save madbook/d9e83edf0b7eb47325e8 to your computer and use it in GitHub Desktop.
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
function* range(begin, end) { | |
for (let i = begin; i < end; i++) | |
yield i; | |
} | |
let buzzWord = (n) => | |
'' + ((n % 3 ? '' : 'fizz') + (n % 5 ? '' : 'buzz') || n) | |
let fizzBuzz = (max = 100) => | |
[for (n of range(1, max)) buzzWord(n)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment