Testing for console.log statements in IE [duplicate]
You don’t have to jump through all these hoops. Simply check if the console exists before using it. So, instead of: console.log(‘foo’); Use: window.console && console.log(‘foo’); …and you won’t get any errors. Alternatively, you could just check for it at the top of your script, and if it’s undefined, just fill it with an empty … Read more