Skip to content

Instantly share code, notes, and snippets.

@couchand
Created March 13, 2014 05:40
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 couchand/9522427 to your computer and use it in GitHub Desktop.
Save couchand/9522427 to your computer and use it in GitHub Desktop.
The Little CoffeeScripter
# the little coffeescripter
# http://weblog.bocoup.com/little-javascripter-revisited/
Y = (le) ->
((f) -> f f) (f) ->
le (args...) ->
f(f) args...
factorial =
Y (f) ->
(n) ->
return 1 if n < 2
n * f(n - 1)
console.log factorial 5 # 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment