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