Quickest way to add object to array

Hi

This is such a simple question I feel stupid for asking it, but after searching the forums and google I still couldn't find the answer:

What is the quickest way to add a string or an object at the end of an array. Like:

local array = {}
local test = "Testing"
array[] = test

That doesn't work, but:
array[1] = test
or
array["first"] = test
does.

For convenience and reference, is there a way to accomplish this without having to keep track of the numbers or keys? I just want to add the object at the end!

Thanks

1
array[#array+1]=test
views:1319 update:2011/10/6 9:28:12
corona forums © 2003-2011