Skip to content

Instantly share code, notes, and snippets.

View sebvilhelm's full-sized avatar

Sebastian Vilhelm Juhl sebvilhelm

  • Copenhagen, Denmark
  • 22:54 (UTC +02:00)
View GitHub Profile
function curry(fn) {
const arity = fn.length;
function fun(n, args) {
return function(a) {
if(n <= 1) {
return fn(...args, a);
}
return fun(n - 1, [...args, a]);
}