Skip to content

Instantly share code, notes, and snippets.

@emmanuelnk
Last active August 1, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmanuelnk/82d50eb6d3aa9d23303704b4312c33ed to your computer and use it in GitHub Desktop.
Save emmanuelnk/82d50eb6d3aa9d23303704b4312c33ed to your computer and use it in GitHub Desktop.
FizzBuzz but with ES6!
const fizzbuzz = (min, max) => new Array(max-min+1)
.fill(0)
.map((f,i) => console.log(`${((i+1)%3 === 0) ? 'fizz' : ''}${((i+1)%5 === 0) ? 'buzz' : ''}` || i+1))
fizzbuzz(1, 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment