Answers for "for i in pairs lua"

Lua
4

lua in pairs

--Table is the table to iterate through
--Index is the current index
--Value is the value at the current index

for index, value in pairs(table) do

end
Posted by: Guest on December-30-2019
4

for i in pairs lua

local table =  {2,3,12, "Hello"} --a simple array
for i, item in pairs(table) do -- for i in pairs loop goes through all the items in an array/table
	print(item)
end
Posted by: Guest on August-27-2020

Browse Popular Code Answers by Language