Sometimes some developers forgot to remove debugger;
in javascript code, and it produce javascript error on IE.
How can you check (like for the console: if(wi
You could attempt to compile a function that declares debugger
as a local variable. If debugger
is reserved as a keyword, the JS engine will throw an error which you can catch.
var debuggerIsKeyword = false;
try {
new Function("var debugger;");
} catch(e) {
debuggerIsKeyword = true;
}
However I'm not sure that knowing whether a keyword exists or not is actually helpful.