From 99d67fa4cb3522a9d1896f8ef37faeaa817dec4f Mon Sep 17 00:00:00 2001 From: Ibrahim Abdulhameed Date: Mon, 1 Sep 2025 11:47:40 +0100 Subject: [PATCH] feat: add logical operators --- source/_posts/lua.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/_posts/lua.md b/source/_posts/lua.md index 9f78172..8b427fd 100644 --- a/source/_posts/lua.md +++ b/source/_posts/lua.md @@ -133,3 +133,21 @@ print(a >= b) -- false -- less than or equals print(a <= b) -- true ``` + +### Logical + +```lua +-- and +false and nil --> false +0 and 20 --> 20 +10 and 20 --> 20 + +-- or +true or false --> true +10 or 0 --> 10 +12 or 4 --> 12 + + -- not +not true --> false + +```