Text

Sep 14, 2010
@ 2:51 pm
Permalink

JavaScript Browser Console dependency, part 2

As a follow up to my previous post on a dummy JavaScript console object, some thoughts on refining it;

if(console === "undefined") {
    var console = {
        log: function() {}
    }
}

Also one additional method could be:

console = console || { log: function() {} }

But, I haven’t yet tested it out properly to see possible brainfarts. Also, don’t forget to include other methods you may depend upon, such as info, warn or error.