Skip to content

Instantly share code, notes, and snippets.

@madbook
Last active August 29, 2015 14:04
Show Gist options
  • Save madbook/d9e83edf0b7eb47325e8 to your computer and use it in GitHub Desktop.
Save madbook/d9e83edf0b7eb47325e8 to your computer and use it in GitHub Desktop.
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