判断table是否为空的方法

使用next,如果返回nil,说明为空

a={};
a["ddd"]="333"
b={};
print(next(a))
print(next(b))

输出结果

ddd333

nil