each(iterable) iterator
Returns an iterator function that iterates over the values of a table or Object.
Parameters
iterable
A table or an Object to iterate on.
Return value
This function returns an iterator function, that when called (or better inside a for..do loop) will get the next value from the iterable variable.Example
list = { 3, "apple", "banana", sys.Directory(".") }
-- outputs all values in the list
for item in each(list) do
print(item)
end