do you have idea of what's the most reliable way to check a javascript null?
what does it mean by undefined vs. null in JavaScript? what undefined vs. null?
How found this when i search about "how to check 'null' Value in Java Script?"
if (myVar == null) { alert('myVar is not set.'); }
have you try this?
What?! This isn't why you don't check for equality with null. It's because myVar == null doesn't even remotely do what most people think it does in this context.
A property, when it has no definition, is undefined. Put that way, it's pretty obvious.
'null' is an object. It's type is 'null'. 'undefined' is not an object, it's type is 'undefined'. That part is less obvious.
So people write
if (myVar == null) {
myVar = "Joe";
}
When what they really mean is
if (!myVar) {
myVar = "Joe";
}
this is where i end up with my search... hope you expert guys would help me if i'm wrong.
Current Readings...
- Oracle JDeveloper and ADF
- Enterprise JavaBeans (J2EE with EJB)
- Ajax for Java-DWR
- Logica SMPP Open Source
- Java Card Technology
- Lottery Results!!! (hik hik heee)
23 July, 2009
Subscribe to:
Post Comments (Atom)
oogle
LinkedIn
No comments:
Post a Comment