How can I check if a lua table contains only sequential numeric indices?
snippet in lua

How can I check if a lua table contains only sequential numeric indices?

user7128

local function isArray(t)
  local i = 0
  for _ in pairs(t) do
    i = i + 1
    if t[i] == nil then return false end
  end
  return true
end