Skip to content

Instantly share code, notes, and snippets.

@liorean
Created April 23, 2015 00:59
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 liorean/f5106e8e33b66aca0c4b to your computer and use it in GitHub Desktop.
Save liorean/f5106e8e33b66aca0c4b to your computer and use it in GitHub Desktop.
Side effect free FizzBuzz in ECMAScript 2015/ES6
((fix=>(fix(z=>(f,a)=>(b,...c)=>(b===void 0?a:z(f,f(a,b))(...c)))
((a,b)=>(a+'\n\t'+((b%3===0?'Fizz':'')+(b%5===0?'Buzz':'')||b)),
'FizzBuzz 1-100:'))
(...fix(z=>(m,n,...y)=>(n<m?y:z(m+1,n,...y,m)))(1,100)))
(f=>((f=>f(f))(g=>f((...a)=>g(g)(...a))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment