Whats the Difference Between These Loops

Saw this today, but couldn’t find anything of it.
What’s the diffference between

for _ in Folder do
end
for _, v in Folder do
end

One has a comma with a value and the other one just has a “_”
Thanks a lot for your help!

In both cases _ indicates the index/key value of the Folder indexable variable, but the second case also contains a v value for that index/key.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.