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.
I am Gayan Belpamulle and this is my web log. This blog includes stuff like my personal details, my photos, my dreams and also some of my nutty works... so, i will be posting my day to day catching to this blog.. enjoy!
Current Status
Actively playing with all possible backend services
23 July, 2009
Subscribe to:
Post Comments (Atom)
Some Popular Posts
-
M.D.K Healthcare Center & Hospital(pvt)Ltd is newly formed private Hospital at Horana with High Tech& High Skilled medical facilit...
-
Hello friends, currently i'm working on a web-based project where we use Struts 1.2 validator framework. I search for this topic but i c...
-
Helo my friends/readers I need a hint to solve problem developed in JDeveloper 11g/ WebLogic Server 10.3.0.0. Application - Struts, JSP , Ja...
No comments:
Post a Comment