Skip to content

Instantly share code, notes, and snippets.

@xiaocang
Created May 8, 2016 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaocang/b061bd364a5ed4972fbdf7b10b01c3a7 to your computer and use it in GitHub Desktop.
Save xiaocang/b061bd364a5ed4972fbdf7b10b01c3a7 to your computer and use it in GitHub Desktop.
lua_table_empty
local next = next -- 绑定函数为本地变量
if next(emptyTable) == nil then
print("This is a empty table")
end
emptyTable = {}
print(unpack(emptyTable) = nil)
emptyTable = {}
if emptyTable == {} then
print("This is a null table")
else
print(emptyTable)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment