Untitled

mail@pastecode.io avatar
unknown
lua
3 years ago
510 B
7
Indexable
Never
-- Written by Glory
-- Recreation of Roblox's Table Library
-- 3/11/22

local table = {}

function table.clear(tbl)
  for i, v in ipairs(tbl) do
    tbl[i] = nil
  end
end

function table.find(tbl, value, startpoint)
  for i = startpoint or 1, #tbl do
    if tbl[i] == value then
      return i
    end
  end
  return nil
end

function table.freeze(tbl)

end

function table.getn(tbl)
  return #tbl
end

function table.insert(tbl, value)
  tbl[#tbl + 1] = value
end

function table.pack(...)
  return {...}
end