[Javascript] typeof

TomMallard mallard at serv.net
Thu May 17 00:28:29 CDT 2001


if(nameID == 'undefined' || nameID == ''){
    // valid nameID
}else{
    // empty
}

tom
----- Original Message -----
From: "Andrew Dunn" <adunn at interworx.com.au>
To: <javascript at LaTech.edu>
Sent: Wednesday, May 16, 2001 9:53 PM
Subject: [Javascript] typeof


> Hi,
>    I have a variable called nameID. This variable holds the name of
another
> variable which is an array. Sometimes the variable that is held in nameID
is
> non-exsistent ie. "undefined". How can I test this?
>
> I've tried typeof(eval(nameID))) but that returns "object". I need a way
to
> see whether the variable that is held in nameID is exsistent. Can anyone
> help me?
>
> Thank you.
>
> Andrew Dunn.
>





More information about the Javascript mailing list