Answers for "how to remove the first element of a table in lua"

Lua
0

lua remove first element of table

local t = {1,2,3,4}
local head = table.remove(t,1)
print( head )
--> 1
print( #t )
--> 3
print( t[1] )
--> 2
Posted by: Guest on January-11-2021

Code answers related to "how to remove the first element of a table in lua"

Browse Popular Code Answers by Language