[Javascript] I can test for undefined...using typeof or === or == please help

Scott.Wiseman swiseman at remax-cahi.com
Fri Aug 10 20:20:04 CDT 2001


non of these if statements catch the undefined
 
but the alert reports 0 undefined.
so what's up.... is there a type???
 
 
here is the code:
 
 
 alert("0 "+mydropdown.options[0].value);
   if(typeof mydropdown.options[0].value == undefined)
   {
    alert("found 1")
    myvalue1 = NULL;
   }
   if(typeof mydropdown.options[0].value == undefined)
   {
    alert("found x 1")
   }
   if(typeof mydropdown.options[0].value === undefined)
   {
    alert("found x 2")
   }
   if(mydropdown.options[0].value == undefined)
   {
    alert("found x 3")
   }
 
   if(typeof mydropdown.options[0].value != undefined ||
mydropdown.options[0].value != "unde" )
   {
    myvalue1 = mydropdown.options[0].value;
   }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010810/d05da990/attachment.htm>


More information about the Javascript mailing list