Code Quality
< Javascript
< Development
< dellerz
Luke Page, March 28th, 2011 In January of this year Douglas Crockford decided that some of the options in JSLint were generally accepted and should always be on. One of those options was eqeqeq, the option to show an error if just two equals was used. For some time JSLint has complained about double equal comparisons against null, 0, undefined and empty string, but this change meant that two variables had to be compared without type coercion.
A semi-colon explicitly placed in the source text must terminate certain statements. Your JavaScript interpreter may help by adding some automatically, but this may not work as you expect. As they say, "Your mileage may vary". Semi-colons are used to explicitly terminate certain keywords so that the parser can determine exactly where the fragment of code begins and ends. The semi-colon removes the ambiguity about how a piece of code is intended to execute.