[thelist] Some confusions about JavaScript

Syed Zeeshan Haider zeeshan_paki at yahoo.com
Mon Mar 4 13:48:15 CST 2002


Hello Experts,
I have some confusions about JavaScript.
1.    I many times observe following situation in JS written by others:
if(!x){
//then do whatever
}
Here x is a variable declared by var. "!x" is confusing. Where do
JavaScripters use such syntax of JS? Which situations need things like
"!x"?
2.    I often use "while" instead of "for" in JavaScript, because "for"
is not very friendly to me. Consider this example:
for(i=0;i<10;i++)
{
// do whatever
}
Will the loop between {} start at i=0 or it will start at i=1?
In the same way, when will the loop end? At i=10 or i=9?
Thank you,
Syed Zeeshan Haider.
http://syedzeeshanhaider.faithweb.com/



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




More information about the thelist mailing list