Regarding JavaScript for() loop voodoo

前端 未结 9 1465
梦如初夏
梦如初夏 2021-02-19 08:53

I was for quite some time under the impression that a for loop could exist solely in the following format:

for (INITIALIZER; STOP CONDITION         


        
9条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 09:52

    The first clause initializes any variables you want to use. The second clause is indeed the stop condition. The third clause includes any logic to be executed at the end of each iteration. Multiple statements can be separated by commas.

提交回复
热议问题