Whats the diffrence of pairs and ipairs

Hi, I wanted to ask whats the diffrence between pairs and ipairs??? Like when would you use them because i see some people use pairs and ipairs for the same thing? So like some people use pairs for part:GetChildren() but some people use Ipairs so whats the diffrence???

because of roblox update, they are not needed now. you can just for _, child in part:GetChildren()

regardless, ipairs work for array (table with numeric index only)
e.g. local array = { "a", "b", "c" }

pairs work on dictionary (table with string index)
e.g. local dictionary = { Key1 = "a", Key2 = "b", Key3 = "c" }
pairs also work on array

3 Likes

Thank you, I was getting so confused

the studio ai code assist would still use pairs or ipairs because i believe it is trained on older scripts.