Apply the function f to the elements of the table passed. On each iteration the function f is passed the key-value pair of that element in the table. table.foreach(tab, func); foreach(tab, func); From TableLibraryTutorial of lua-users.org. > table.foreach({1,"two",3}, print) -- print the key-value pairs 1 1 2 two 3 3 > table.foreach({1,"two",3,"four"}, function(k,v) print(string.rep(v,k)) end) 1 twotwo 333 fourfourfourfour If the function f returns a non-nil value the iteration loop terminates.
| Entity | Attribute | Value | Rank |
|---|