Possible Duplicate:
javascript undefined compare
This always confuses me and I can never find a definantive answer, nor does it seem when I try one or the other does it conclusively show me that one way or the other works or works better then the other.
I see people do:
typeof system_obj.alpha !== 'undefined'
!typeof system_obj.alpha == 'undefined'
typeof system_obj.alpha != 'undefined'
but in any of the cases, I always end up with a false positive now and again. So my question is, when I want to know wether not a string isn't null, or undefined or if I want to check to see that the type of is not something then do something based on that I always end up with something like
if(typeof system_obj.alpha == 'undefined'){/*ignore*/}else
{
//code
}
How do I do that properly without having to use the if-else logic like I end up doing anyway