JSLint Error Solution

I started using JSLint. I checked my code and I get the following errors:

Problem with line symbol 92 7. Move the call to the pairs containing this function.
})();

Problem with line symbol 92 7: Wrap the entire immediate function call in parens.
})();

How to fix these errors?

+31
javascript jslint
Sep 20 '09 at 10:25
source share
2 answers

I believe this means that you should move the function that calls parens inside the parens wrapper

 (function() { /* code */ })() 

The last two paranas that perform the function are a problem. That is how jslint wants it to look like this:

 (function() { /* code */ }()) 
+59
Sep 20 '09 at 10:49
source share

I found a good explanation here: http://james.padolsey.com/javascript/closures-in-javascript/

The first set of brackets (near " function(){} ") is not required, but is used to make it obvious that the function is called immediately, which makes it obvious that the expression does not necessarily return this function; but instead, the return value of this function

+35
Sep 26 '09 at 15:59
source share



All Articles