Learn Lua in Neovim: Booleans, Nil & Comparisons — The Truthy Gotcha | Episode 5
7views
1likes
07:51
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Not everything is true or false in the way you'd expect! In this episode we cover Lua's boolean and nil types, all six comparison operators, and Lua's
truthy/falsy rules — including the classic gotcha that 0 and "" are truthy in Lua (unlike most other languages).
Every keystroke is shown on screen with 3-second pauses so you can follow along at your own pace.
What You'll Learn:
- true and false — Lua's boolean literals
- nil — the absence of any value
- ~= is "not equal" (not != like other languages)
- Why 0 and "" are truthy in Lua
- Only false and nil are falsy
Source Code:
https://github.com/GoCelesteAI/learn-lua-in-neovim
Timestamps:
0:00 - Introduction
0:12 - What You'll Learn (Preview)
0:44 - Comparisons — Greater & Less Than
1:19 - yy/p — Yank and Paste
1:32 - Equality == and ~= (Not Equal)
2:49 - cw — Change Word
3:24 - The Truthy/Falsy Gotcha
6:06 - Recap: Key Takeaways
6:38 - End Screen
Key Takeaways:
1. true and false are Lua's boolean values
2. nil means a variable has no value
3. ~= is not-equal, not != like other languages
4. Only false and nil are falsy in Lua
5. 0 and "" are truthy — a common beginner trap
This is Episode 5 of the Learn Lua in Neovim series. New episodes cover user input, if statements, loops, and more — all coded inside Neovim.
Taught by CelesteAI. Like & subscribe for more tutorials!
#lua #neovim #programming #tutorial #beginners #learnlua #luaprogramming #neovimtutorial #booleans #luanil #coding
Tags
lua, lua tutorial, learn lua, lua boolean, lua nil, lua true false, lua comparison operators, lua truthy falsy, lua == operator, lua ~= not equal, lua 0
truthy, lua empty string truthy, lua for beginners, neovim lua, neovim tutorial, learn lua in neovim, lua episode 5, programming tutorial, coding tutorial,
beginner programming, lua 2026, neovim 2026, screenkey, code along, lua basics, lua gotcha
Tags
lualua tutoriallearn lualua booleanlua nillua true falselua comparison operatorslua truthy falsylua == operatorlua ~= not equallua 0 truthylua empty string truthylua for beginnersneovim luaneovim tutorial