Precepts from our JavaScript dictator
Posted in Miscellaneous on October 30th, 2009 by Thomas – Be the first to commentAlways declare your variables and functions:
Variables which are not declared will be global. This can result in many bugs hard to detect.
Always declare your variables in top of your block:
JavaScript does not have block scope, and it is better to always declare all variables at the top of each function.
