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
}
Moderator: General Moderators
Code: Select all
if (variable === undefined)
{
//it doesn't exist
}
Code: Select all
if (typeof variable == "undefined")
{
//it doesn't exist
}