table.clear
Removes all values in a table. This operation has O(n) complexity, where n is the number of entries in the table.
Usage
table.clear(my_table)
Arguments
| Name | Type | Description |
|---|---|---|
my_table | table | Table to clear. |
Examples
local list = { "fairy", "demon", "elf", "dragon" };
print(#list); -- Prints "4"
table.clear(list);
print(#list); -- Prints "0"