Top "Jslint" questions

JSLint is a "code quality" tool for JavaScript developed by Douglas Crockford, a well-known developer also responsible for JSON, JSMin, ADSafe and parts of YUI.

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error: Problem at line 1 …

javascript syntax jslint use-strict
How to initialize an array's length in JavaScript?

Most of the tutorials that I've read on arrays in JavaScript (including w3schools and devguru) suggest that you can …

javascript arrays jslint
Why avoid increment ("++") and decrement ("--") operators in JavaScript?

One of the tips for jslint tool is: ++ and -- The ++ (increment) and -- (decrement) operators have been known to …

javascript syntax jslint postfix-operator prefix-operator
JSLint says "missing radix parameter"

I ran JSLint on this JavaScript code and it said: Problem at line 32 character 30: Missing radix parameter. This is the …

javascript jslint radix
JSLint is suddenly reporting: Use the function form of "use strict"

I include the statement: "use strict"; at the beginning of most of my Javascript files. JSLint has never before warned …

javascript jslint
Why does JSHint throw a warning if I am using const?

This is the error I get when using const: <error line="2" column="1" severity="warning" message="&apos;const&…

javascript node.js constants jslint jshint
Should I use JSLint or JSHint JavaScript validation?

I am currently validating my JavaScript against JSLint and making progress on, it's assisting me to write better JavaScript - …

javascript jslint jshint
What is the difference between `new Object()` and object literal notation?

What is the difference between this constructor-based syntax for creating an object: person = new Object() ...and this literal syntax: person = { …

javascript object jslint
What does the JSLint error 'body of a for in should be wrapped in an if statement' mean?

I used JSLint on a JavaScript file of mine. It threw the error: for( ind in evtListeners ) { Problem at line 41 …

javascript jslint
Empty functions in Javascript

If I have something like this: var blah = function() { }; and then later in code blah is being used, what is …

javascript jslint