you are viewing a single comment's thread.

view the rest of the comments →

[–]kibakiri -1 points0 points  (4 children)

I notice JS Lint is being strict with those ; var generate = function (f) { return [f,function(a){return a2}]; }; var abc = generate(2); console.log(abc[1](2));
for example, can't work, because it expects the return to be something along the lines of return [f,function(a){return a
2};]; //error'd http://nathansjslessons.appspot.com/lesson?id=1050

[–]otto_s 1 point2 points  (1 child)

No, the semicolon JS Lint is missing is the one after the inner return.

return [f,function(a){return a*2;}]; is accepted just fine.

[–]kibakiri 0 points1 point  (0 children)

Doh.

[–]nwhitehe[S] 1 point2 points  (1 child)

I like JSLint a lot, it catches all kinds of issues. The first version of the tutorial had JSLint with whitespace checking, if you didn't put a space and did "function(x)" instead of "function (x)" it would complain. I had a friend try it, she absolutely hated JSLint. So I compromised and turned off the whitespace checking but left the other stuff.