infinnie / infinnie.github.io

https://infinnie.github.io/
Apache License 2.0
0 stars 1 forks source link

That was (sorta) what I wanted. #10

Open infinnie opened 7 years ago

infinnie commented 7 years ago

image

image

Update: time to try some ES6.

image

infinnie commented 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;
};