Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is the difference between for i,v in pairs and for i,v in ipairs?

What is the difference between for i,v in pairs and for i,v in ipairs?

2 answers

ipairs iterates through numerical indexes until it reaches a nil index. pairs iterates through all indexes and ignores nil indexes.

2 comments

0

So if I used ipairs it would go Part, Part, Part, Message and then it would stop.

0

No.Please reread my answer.

pairs goes through everything even if its nil, ipairs stops when it notices something is nil in the script.

This discussion is preserved as it was. New answers, comments, and votes are closed.