What is the difference between ipairs and pairs in for loops?

Hello, I have been pondering over this question for quite a few years, and now I feel that it should be brought to light. What is the difference?

eg
#1
for _,v in pairs(game.Players:GetPlayers()) do
print(v)
end

#2
for _,v in ipairs(game.Players:GetPlayers()) do
print(v)
end

Both of these lines seem to function identically, and I have used ipairs and pairs interchangeably as a result.

This topic was automatically closed after 8 minutes. New replies are no longer allowed.