Skip to content

Instantly share code, notes, and snippets.

View madbook's full-sized avatar

Matthew Lee madbook

  • reddit
  • Pittsburgh, PA
View GitHub Profile
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)]