Array / Lua table for JavaScript

1

I have an array in the Lua language, and wanted to pass its elements to an array JavaScript. Example of array Moon:

tabela_y = {0, 1, 2}

In PHP there is the implode, I do not know if it is possible in Lua.

    
asked by anonymous 18.03.2015 / 16:27

1 answer

3

There is the concat function that does this:

tabela_y = {0, 1, 2}
print(table.concat(tabela_y, ","))

See working on ideone .

    
18.03.2015 / 16:35