JSFiddle - React, Tailwind, and code Playground
by ciju
JavaScript
var s3 = function (h) {
return (function (f) { // sum function
return function (n) {
return n === 1 ? 1 : n + f(n - 1);
};
})(function (n) {
return h(h)(n);
});
}
console.assert(s3(s3)(5) === 15, s3(s3)(5));