nanos world API Reference Unofficial documentation
Static function Shared Native

table.remove

Removes from <code>tbl</code> the element at position <code>index</code>, returning the value of the removed element.<br /><br />When <code>index</code> is an integer between 1 and <code>#tbl</code>, it shifts down the elements <code>tbl[index + 1], tbl[index + 2], ···, tbl[#tbl]</code> and erases element <code>tbl[#tbl]</code>.<br /><br />The <code>index</code> can also be 0 when <code>#tbl</code> is 0, or <code>#tbl + 1</code>.

Syntax

Lua
table.remove(tbl, index)

Parameters

Name Type Default Description
tbl table The table to remove the value from.
index number The index of the value to remove.

Returns

  • any