Open infinnie opened 7 years ago
var curry = function (f) {
/// <summary>do something interesting</summary>
/// <param name="f" type="Function"/>
"use strict";
var len = f.length, ret = function () {
var args = Array.prototype.slice.call(arguments);
if (args.length < len) {
return function () {
return ret.apply(null, args.concat(Array.prototype.slice.call(arguments)));
};
}
return f.apply(null, args);
};
return ret;
};
Update: time to try some ES6.