How To Get Last Element Of Array In Lua

[Solved] How To Get Last Element Of Array In Lua | Lua - Code Explorer | yomemimo.com
Question : how to get last element of array in lua

Answered by : troubled-tuatara-xo2aa6o5104q

local arr = {1,2,3,4,5,6,7,8,9,10}
for i,v in pairs(arr) do	last = #arr - 0
end
print(last)

Source : | Last Update : Tue, 08 Sep 20

Question : lua last item in table

Answered by : cole

table[#table]

Source : https://scriptinghelpers.org/questions/75451/how-do-you-index-the-last-element-in-a-list | Last Update : Thu, 18 Jun 20

Answers related to how to get last element of array in lua

Code Explorer Popular Question For Lua