Strict mode in Javascript is recommended. You get it by putting this line near the start of the script:*
'use strict';
This tells the interpreter to give warnings about code to be deprecated, force you to declare variables, and some other good things. The way you'll notice it is it'll make your script crash on undeclared variables. To declare them, use var:
function myFunc (arg1)
{
var localVar = ['something','or','another'];
...
}
function myFunc (arg1)
{
'use strict';
var localVar = ['something','or','another'];
...
}