for...each
Loop
for...each
loop, which is used exclusively to loop through elements in an array.
The upper script is the syntax of the for...each loop.
The lower script is an example, which outputs all elements in the cars array, using a for...each loop.
|
|
|
|
for...each
loops include:
|
|
|
|
|
|
|
|
An apple a day keeps the doctor away. |