JSFiddle - React, Tailwind, and code Playground
JavaScript
Function.prototype.curry = function() {
var fn = this, args = Array.prototype.slice.call(arguments);
return function() {
return fn.apply(this, args.concat(
Array.prototype.slice.call(arguments)));
};
};
function mul(a, b) {
return a * b;
}
console.log(mul.curry(2)(3));