a(1)(2)(3)(4)(5);
const x = a(1)(2)(3)(4)(5);
console.log(x); // 15
const a = (() => {
this.acc = 0;
return x => {
if (typeof x === "number") {
this.acc += x;
}
if (this.acc >= 15) {
return this.acc;
}
return a;
};
})();
a(1)(2)(3); // 6
const a = v1 => {
const f = v2 => a(v1 + v2);
f.valueOf = () => v1;
return f;
};
a(1)(2)(3)(4)(5) * 6 // 90
10 + a(4)(5)(6) // 25
Math.pow(a(8)(1), 3) // 729
a(4)(6) - a(3) // 7