hotwheelharry
06-13-2008, 11:18 AM
why is it that this does not work?
//var Variable = 2;
if(Variable){
alert('undefined');
else{
alert('defined');
}
I thought that if you test something in an if/else statement and it was undefined, then it meant false and went to the else part.
I ran this in IE6 and FF and they both throw errors.
but if(undefined) works fine. Whats the deal?
//var Variable = 2;
if(Variable){
alert('undefined');
else{
alert('defined');
}
I thought that if you test something in an if/else statement and it was undefined, then it meant false and went to the else part.
I ran this in IE6 and FF and they both throw errors.
but if(undefined) works fine. Whats the deal?