Something like this
local test = {for i=0,4 do i}
test --> {0,1,2,3,4}
I know in python you can do it, its called list comprehension, but I wasn’t able to find anything regarding how to do it in Lua
Something like this
local test = {for i=0,4 do i}
test --> {0,1,2,3,4}
I know in python you can do it, its called list comprehension, but I wasn’t able to find anything regarding how to do it in Lua
local test = {}
for i = 0,4 do
test[i+1] = i
end
No you cannot do it at same time