I have read Crockford's JavaScript: The Good Parts and have used his validator JSLint. I am sometimes left wondering the justification behind his recommendations. Below is a list of examples I want substantiated.


  1. Why does JSLint signal an error if you don't include "use strict";? [See this SO thread.]

  2. Why should variable declarations within a function be done using a single var? [See this SO thread.]

  3. Why do we need to put a space between function and () in function ()?

  4. Why can't we use continue?

  5. What is wrong with ++ and --?

  6. Why can't we use the comma operator , (except in the initialisation and incrementation parts of the for statement)? [See this blog post.]

  7. Why should every single statement end with ;? [See this blog post.]

Edit
Report