Console is fucking undefined !

Tuesday, 25 August 2009 09:07 by MartinKirk

In Javascript, it’s possible to test if a variable is undefined without even instantiating the variable.

like this:

if(console){ console.log(“”) }

or

if(console != undefined){ console.log(“”); }

But, in IE8, by some freaking act of god, it’s completely impossible to test if console is undefined. you may test if bogus==undefined or do a if(bogus) test, without any problems. But you CAN’T test if console is defined, doing so throw an error : “console is undefined”

 

ARGHHH

i want to kill someone

Tags:   ,
Categories:   Javascript
Actions:   E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Comments

August 25. 2009 14:03

tobi

Like that?:

if(window.console){ console.log(“”) }

tobi

Comments are closed