Skip to content

Instantly share code, notes, and snippets.

@cem2ran
Created May 31, 2015 20:12
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 cem2ran/f3afca5dbe52577c347b to your computer and use it in GitHub Desktop.
Save cem2ran/f3afca5dbe52577c347b to your computer and use it in GitHub Desktop.
const range = ({start=0, end=1})=> [...Array(end - start + 1)].map((_, i) => start + i);
const fizzbuzz = (num=100) => [for (x of range({end: num})) (!(x%3)?"Fizz":'')+(!(x%5)?'Buzz':'')]
console.log(fizzbuzz(30))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment