A while ago I posted a THIS question, regarding interaction between lua.vm.js and javascript.
Now I have a slightly different problem:
Lets assume that I have the following code in the REPL
model = {}
model['test1'] = 1
model['test3'] = 2
model['test4'] = 3
model['test5'] = 4
model['test6'] = 5
local window = js.global
window.model = model
Because I'm using lua.vm.js, I now that from javascript I can get all the values by doing
window.model.get('test1')
window.model.get('test2')
window.model.get('test3')
But the problem with that is that I have to know beforehand that the entries at the table are "test1", "test2", etc.
Is there a way in javascript(or maybe by adding some more Lua code) that I can iterate all over the table without knowing all the entries?
Thanks in advance!
(for var in obj)looping work?pairsto iterate over all of the table entries. I can't find anything for lua.vm.js though; there's very little documentation for it.