[SOLVED]Variable set or not?
Posted: Sun Oct 07, 2007 1:08 am
How do I check if a variable has been defined or set?
I use:
But of course a variable has to be defined in order to check if a defined variable is undefined... So how do I check if a variable exists?
EDIT:
Nevermind, I got it.
I use:
Code: Select all
if (variable === undefined)
{
//it doesn't exist
}
EDIT:
Nevermind, I got it.
Code: Select all
if (typeof variable == "undefined")
{
//it doesn't exist
}