ipairs loop only number indexes ( start from 1 index ) and only in order.
pairs loop all.
Examples (ipairs)
-- Example 1
for n, s in ipairs{ 'new', 'next' } do -- { [1] = 'new', [2] = 'next' } is some
print( n, s )
end
--[[
1 new
2 next
]]
-- Example 2
for n, s in ipairs{ [1] = 'new', [3] = 'next' } do
print( n, s )
end
--[[
1 new
]]
-- Example 3
for n, s in ipairs{ [0] = 'new', [1] = 'next' } do
print( n, s )
end
--[[
1 new
]]