Lua 中的 nil 类型和 type of nil 类型的区别是什么?

> print(type(X))
nil
> print(type(type(X)))
string
> print(type(nil))
nil
>

为什么最后两个打印结果不同?

点赞
用户11405174
用户11405174

typetype 会是字符串,因为 type 总会产生一个字符串。

参见:https://www.lua.org/pil/2.html

2019-11-07 14:09:50