News for hackers. Stuff that matters.
Re:Currying in JavaScript by couchand on Sunday July 19, 2015 @10:43PM (#9913782)
We can tell how many arguments a function expects by accessing its length property.

While that works for many cases it isn't generally true. For instance:

    function wtf() { return arguments[0]; }
While that may seem like a ridiculous example, the following idiom is quite common in JS programming:

    function accessor(value) {
        if (typeof value === 'undefined') {
            return getValue();
        }
        else {
            setValue(value):
        }
    }
In general it's not a good idea to expect any particular value for a function's length property.
Re:Currying in JavaScript by kevincennis on Sunday July 19, 2015 @11:02PM (#9913821)
Right, but you wouldn't curry those functions.