Talk about looping statements in JavaScript---------for statements
for (Var value=1;value<10;value++) {
}
First take a look at the above code, we analyze the part of the For statement
var value=1: Initializing the loop variable
VALUE<10: Cyclic Judging conditions
value++: Increments the loop variable (or it can be a decrement variable)
{}: code block in the loop body executed
Then we clean up the execution process:
1. Execute the initialization portion of the for statement.
2, check the loop to determine the condition, if true, continue to execute the FOR statement, if False, the For statement is introduced.
3. Execute the code in the loop body in the for statement.
4. The increment part of the loop variable that executes the For statement (descending part).
5. Repeat steps 2nd through 4th.
Then we look at the complete code:
After reading the For statement, let's take a look at the for...in Loop statement
For...in Loop statement: Mainly used for array type and object type data, to traverse the data, do not need to know the number of data.
Look at the following code:
For an array, see http://blog.csdn.net/hai_qing_xu_kong/article/details/40934835
Reprint Please specify source:http://blog.csdn.net/hai_qing_xu_kong/article/details/41356699 Emotional Control _
JavaScript Language Basics 13