What do pairs and ipairs mean?The comment on the question is something i have to do when i make a question how do i SEARCH?
✓ ANSWER ACCEPTED
Explanation of pairs and ipairs please?
1 answer
✓ Accepted answer
pairs will go through everything in a mixed table, ipairs won't.
Example:
local t={"SamuelKingx","Is","Epic",Yolo="You only live once"}
for i,v in pairs(t) do
print(i,v)
end
--[[
Output:
1 SamuelKingx
2 Is
3 Epic
Yolo You only live once
]]
for i,v in ipairs(t) do
print(i,v)
end
--[[
Output:
1 SamuelKingx
2 Is
3 Epic
]]
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Please use the search feature before asking a question. This specific question has been asked quite a lot, so there are a lot of answers you can check.