Can anyone explain me how the functions Next and In Pairs Mean? The wiki is just too complicated for me.
✓ ANSWER ACCEPTED
Can anyone explain me how the functions Next and In Pairs Mean?
1 answer
✓ Accepted answer
pairs(table) returns next,table,nil.
in a for loop, you can use it to loop over each key,value in the given table.
Eg.
local Example = {
"Hello";
"World";
"Bye!";
}
for _,Value in pairs(Example) do
print(Value)
end
--[[
this would print
Hello
World
Bye!
]]
This discussion is preserved as it was. New answers, comments, and votes are closed.
