谁能解释一下我们如何在 Lua 中获得以下代码的输出?

Can anyone explain how we will get the output of the following code in Lua?

function ReturnTwoVal()
return "1","2"
end
function ReturnThreeVals()
return "x","y","Z"
end
TblA = {ReturnThreeVals(),ReturnTwoVal() }
print(TblA[2],TblA[1], TblA[2], TblA[3], TblA[4])

输出将为:1 x 1 2 nil

将 return 多个值调整为单个值的表达式,除非它们是函数调用或 table 构造函数中的最后一个表达式。

因此,

TblA = {ReturnThreeVals(),ReturnTwoVal() }

相当于

TblA = {"x", "1","2"}