lua type
helloz 4/11/2024 lua
local num = 123
local str = "Hello"
local tbl = {}
local nilVar = nil
local func = function() end
print(type(num)) -- 输出 "number"
print(type(str)) -- 输出 "string"
print(type(tbl)) -- 输出 "table"
print(type(nilVar)) -- 输出 "nil"
print(type(func)) -- 输出 "function"
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11