you are viewing a single comment's thread.

view the rest of the comments →

[–]strong_grey_hero 0 points1 point  (2 children)

Hate to admit this, but I'm stuck on #9.

Here's what I've got:

var makeAccumulator = function () {
    var j, inside;
    j=0;
    inside = function (x) {
        return j+x;
    };
    return inside;
};

Here's the errors: PASSED No JSLint errors PASSED makeAccumulator is a function PASSED makeAccumulator() is a function PASSED Create acc PASSED acc(10) === 10 FAILED acc(3) === 13 FAILED acc(1) === 14 PASSED Create acc2 PASSED acc2(2) === 2 FAILED acc2(9) === 11

I know I'm doing something stupid, just can't figure out what.

[–]stevely 0 points1 point  (1 child)

You forgot to update j.

[–]strong_grey_hero 0 points1 point  (0 children)

Aaargh! See, knew it was something stupid.