I was using console.log() in some JavaScript I wrote and an error of: console is not defined was thrown in Internet Explorer (worked fine in other
Edit of @yckart's answer
Using c.length as input to a function which defines c won't work. Also you're just reassigning items in the array with noop when you should be adding methods to window.console.
(function(w){
var c = 'assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn'.split(','),
noop = function () {};
w.console = w.console || (function (len) {
var ret = {};
while (len--) { ret[c[len]] = noop; }
return ret;
}(c.length));
})(window);