The javascript, when run through JSLint yells at me and I am not sure why.
/*jslint browser: true, devel: true, evil: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, newcap: true, immed: true */
var foo = function() {
try {
console.log('foo');
} catch(e) {
alert(e);
}
try {
console.log('bar');
} catch(e) {
alert(e);
}
};
foo();
It tells me:
Problem at line 12 character 11: 'e' is already defined.
} catch(e) {
It appears to be upset that I have a second catch(e)
. Why would this be an issue? Does it not simply set e to local variable inside the catch block? Do I need to uniquely name the local variables for all trapped errors in a function?