Different between return nil and return false (SOLVED)

Hi there, if you know well about return… this is your time…
And I am already know that the return use for retrun a value…

teach me return nil

  return nil

teach me return false

  return false

thanks for all…

1 Like

tell me… why does not anyone answer me…

Are not here anyone who knows about that.

You posted the question at 5 in the morning in Europe. It’s 8:10 now. And night the US.

If you Google: “difference between nil and false in lua” you get a very thorough answer as the first search result: lua-users wiki: Expressions Tutorial

“In Lua both nil and the boolean value false represent false in a logical expression. Anything that is not false (either nil or false ) is true . There are more notes on the implications of this at the end of this page.”

Edit: The Lua manual also has some info: Programming in Lua : 2

true and false is of the Lua type “boolean”. nil is its own type “nil”. So they are also two different types but both false and nil evaluate to false in an expression.

10 Likes

:unamused::unamused::unamused::unamused::roll_eyes::roll_eyes::roll_eyes::roll_eyes::confounded::confounded::confounded::confounded::defold:

1 Like

Keep trying to learn. It takes time, don’t get discouraged. :cowboy_hat_face:

1 Like

thankx @Pkeod