Skip to content

Instantly share code, notes, and snippets.

@Dafrok
Created July 2, 2015 03:07
Show Gist options
  • Select an option

  • Save Dafrok/c29df0eb743fe032cfca to your computer and use it in GitHub Desktop.

Select an option

Save Dafrok/c29df0eb743fe032cfca to your computer and use it in GitHub Desktop.
curry
function add(n){
var _callee=arguments.callee
if(typeof(n)=='number'){
return function(m){
if(typeof(m)=='number'){return _callee(n+m)}
else{return n}
}
}
}
console.log(add(1)(2)(3)(4)(5)())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment