kkxx
kkxx

Reputation: 571

what is the difference between the type of nil and the type of type of nil in lua?

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

Why are the last two prints having different results?

Upvotes: 2

Views: 55

Answers (1)

Corsaka
Corsaka

Reputation: 422

The type of the type of anything will be a string because type always results in a string.

See: https://www.lua.org/pil/2.html

Upvotes: 1

Related Questions