152 Views
Anyone familiar with Crockford and jshint will be familiar with the onevar rule - all variables must be declared in a single var statement at the top of the file. function myFunc() { var i, j, date, myVariable; ... } There is logic behind it;- this is what the language is actually doing, so if you write your code like this, no variable hoisting will occur and therefore people reading your code will not have to worry about hoisting and instead concentrate on program function.
0 comments