Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Function composition in JS

Name: Anonymous 2012-09-27 1:26

Is there a smarter/better way to write this?


function c() {
    var fs = arguments;
    return function(x) {
        return Array.prototype.reduceRight.call(fs, function(x, f) {
            return f(x);
        }, x);
    }
}

Name: Anonymous 2012-09-27 2:40

Fucking disgustingly ugly.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List