That it should alert 'false', but since you're posting it, I'm sure it alerts 'true'.<BR><BR>0 and "" are probably treated the same at first. Try <BR><BR>var abc = 10;<BR>alert (abc == "")<BR><BR>and that'll probably give you false then.
>you have shown me how to alert false :p<BR><BR>Huh? I thought that was why you were posting it?<BR><BR>>at first?? How could they possibly be the same.....<BR><BR>How are they different? It's a VARIANT, which means an uninitalized variant will be 0 or "". So it probably sees them the same. Did you try the example with setting it to 10 instead?<BR><BR><BR>What was the purpose of this exercise? Didn't you try this out before posting it?<BR>
i was wondering WHY it was true...cause we BOTH know 0 is NOT the same as an empty string...basically looking for an explanation<BR><BR><BR>>which means an uninitalized variant will be 0 or ""<BR>ok so if i use parseInt on abc should'nt it return false?<BR><BR>>Didn't you try this out before posting it?<BR>uh...yes<BR>
You may have found a bug, but I can see how it was overlooked... these are all valid statements, no?<BR><BR>var x; //who knows? Null? 0? ""?<BR>x = 0; //a number<BR>x = "hello"; // now a string<BR>x = new Date(); //now a date<BR>x = Server.CreateObject.. //now an object<BR><BR>Well, when the engine turns the thing into a new type, it has to initialize it to something. Maybe they have some sort of glitch?<BR><BR>Ooh, this returns true as well...<BR><BR>alert(0 == "");<BR><BR>Perhaps it has nothing to do with the variable then? <BR><BR>Why are you making me think so late in the day? It's cause I'm not on Pacific time and you're around longer to torture me :p<BR><BR>
to throw that at ya and ask you to put that in your pipe and smoke it<BR><BR><BR>i tried the 0 == "" and it lays to waste your "theory"<BR><BR>>Why are you making me think so late in the day?<BR>comon you have to start sometime in your life :p<BR><BR><BR><BR>i got to packages sent out....only the oldies are left.....should have it out by the end of this week....you MAY need some brass polish....maybe i should open it and see how badly the brass tarnished......hmmm does brass tarnish....i know silver does...what does brass do then...lets leave it at tarnish.....dotn think i will open it up though....too much of a headache to pack it again<BR><BR><BR><BR><BR><BR>
Gots plenty of polish.<BR><BR>Dunno what to tell you about 0 == "". Are you that bored at work that you're just throwing things into alert boxes?<BR><BR>Well, I'm outta for today. See yas tomorrow.