The most commonly used one is for (initial value of loop variable; loop condition; increment value) {statement;}
Example
]
The following are other usages
(1) Omit expression 1. At this time, the loop variable should be assigned an initial value before the for statement. Pay attention to the following; cannot be omitted.
Example:
If you need to introduce external Js, you need to refresh to execute
]
(2) Omit expression 2, that is, the loop condition loop continues without termination, that is, expression 2 is always true.
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh it to execute
]
[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute it
[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute ]
逗号表达式按从左-右的顺序整个逗号表达式的值为最右边的值。
这个就是
(7) 表达式可以是逻辑表达式,字符表达式,只要非false就可以执行循环
从这些可以看到for与while循环比起来功能很强大.