for
, break
, and continue
Tags
Allows you to iterate over an array and execute code for each item in the array.
Description
for
loops iterate over an array and allow you to execute code for each item in the
array.
You can also provide a range of numbers using surrounding parentheses and 2 dots between the numbers in the range:
break
allows you to interrupt the for
loop and exit out of it entirely:
continue
allows you to skip to the next iteration of the loop:
Parameters
-
limit
-
integer
Limits the number of iterations through the loop. -
offset
-
integer
Starts looping at a given index. -
reversed
-
boolean
Reverses the order of the loop.