for (variable_name = start_value; variable_name <= end_value; variable_name = variable_name + increment_value) {
            //	Code of block to be executed
        }












for (i = 1; i <= 10; i = i + 1) {
            //	Code of print numbers
}




Value of variable iIs condition i <= 10 satisfiedAction
1NoExecute the code block and Increment value of i
2NoExecute the code block and Increment value of i
3NoExecute the code block and Increment value of i
4NoExecute the code block and Increment value of i
5NoExecute the code block and Increment value of i
6NoExecute the code block and Increment value of i
7NoExecute the code block and Increment value of i
8NoExecute the code block and Increment value of i
9NoExecute the code block and Increment value of i
10YesExit loop









while (condition) {
            //    code to be executed
}




i = 1;
while (i <= 10) {
 // Code to execute
 i++;
}











do {
  //    code to be executed
}
while (condition);






var i = 2;
do {
   //  Code to execute
}
while (i == 1);

















for (variable_name in object) {
                    //    code to be executed
}




var obj = new Object();
obj['name'] = 'karan';
obj['address'] = 'India';
obj['tech'] = '.net';








for(x in obj)
{
  alert(x);
 // alert(obj[x]); // this will prompt karan, India and .net
}



Posted By  -  Karan Gupta
 
Posted On  -  Monday, July 16, 2012

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250