i simply love javascript ... it's so elegant (imagine the quiet sound of lovestruck fanboy sighing in the background).
so, recently i have played with Lua via the löve2d framework (nice!) - and i think Lua is also great. they way i see it, those two languages are very similar.
there are obvious differences, like
- syntax
- problem domain
- libraries
- types (a bit)
but which are the more subtle ones? is there anything a javascript coder would take for granted that works in Lua just slightly different? are there any pitfalls that may not be obvious to the experienced coder of one language trying the other one?
for example: in Lua, arrays and hashes are not separate (there are only tables) - in javascript, they are numerical Arrays and hashed Objects. well, this is one of the more obvious differences.
but are there differences in variable scope, immutability or something like this?