An Interesting phenomenon of Lua's table

后端 未结 2 1335
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 03:45

I\'m new to Lua, and I\'m learning the usage of table these days. From tutorials I know that Lua treats numeric indexed items and non-numeric indexed items differently, so I

2条回答
  •  Happy的楠姐
    2021-01-05 03:50

    The length of a table t is only defined if the table is a sequence, that is, the set of its positive numeric keys is equal to {1..n} for some integer n.

提交回复
热议问题