Skip to content

Instantly share code, notes, and snippets.

@bcruddy
Created August 9, 2016 18:26
Show Gist options
  • Save bcruddy/bf855d71356994dd2c94fd1ae8a241e2 to your computer and use it in GitHub Desktop.
Save bcruddy/bf855d71356994dd2c94fd1ae8a241e2 to your computer and use it in GitHub Desktop.
const fizzbuzz = Array.apply(null, {length: 100}).map(Number.call, Number).map(n => { let res = ''; res += n % 3 === 0 ? 'fizz' : ''; res += n % 5 === 0 ? 'buzz' : ''; return res.length ? res : n; }).join('\n\r');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment