just a note: Lua is basically a very cleaned up version of Javascript. if their APIs were the same you could practically do a literal transcription between them and most programs would run with little alteration. that includes things like object literals (lua tables).
example:
(function(a, b) { return a * b; })(1) //valid javascript (NaN)
(function(a, b) return a * b end)(1) //valid lua (runtime error)
example: