The following code:
[0, 1, 2][2];
[].length;
"hello".length;
({ x: 0 }.x);
produces:
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____ = {
0,
1,
2,
}[2 + 1] -- ❌ invalid Lua syntax
local ____ = #{} -- ❌ invalid Lua syntax
local ____ = #"hello" -- ❌ invalid Lua syntax
local ____ = ({x = 0}.x) -- ❌ invalid Lua syntax
If the table or string were wrapped in () the Lua code would work.