Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago

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

2 answers

Log in to vote
2
Answered by
Kozero 120
10 years ago

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

0
So if I used ipairs it would go Part, Part, Part, Message and then it would stop. BosswalrusTheCoder 88 — 10y
0
No.Please reread my answer. Kozero 120 — 10y
Ad
Log in to vote
0
Answered by
Vividex 162
9 years ago

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

Answer this question