use strict' in javascript
//It's a new feature of ECMAScript 5.
//With strict mode, you can not, for example, use undeclared variables.
Insert a 'use strict'; statement on top of your script:
/***START ANY JS FILE***/
'use strict';
var a = 2;
....
/***END***/
Or, insert a 'use strict'; statement on top of your function body:
function doSomething() {
'use strict';
...
}