FOREACH


This loop will repeat the function for each entry of a numbered table as if you call the function and pass the value of the table to the function.

foreach( table, function )
table variable name of a numbered table
function a function name, without parentheses, that will be called to run repeatedly and given the value of each table entry each time it is run.

Example Table:


HighScores
1 984
2 145
3 103
foreach( highscores, print )

-- prints: 984 145 103

Images in this Guide by NerdyTeachers is licensed under CC BY-SA 4.0

1623

31 Dec 2024

Font