From 49c4cfbe72d73da5b398644a200d27e5091beae7 Mon Sep 17 00:00:00 2001 From: Ibrahim Abdulhameed Date: Mon, 1 Sep 2025 12:54:48 +0100 Subject: [PATCH] feat: add ternary conditional --- source/_posts/lua.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/_posts/lua.md b/source/_posts/lua.md index d0e11b3..815b935 100644 --- a/source/_posts/lua.md +++ b/source/_posts/lua.md @@ -185,6 +185,11 @@ elseif num < 10 then else print("num is 10") end + +-- making a ternary operator +-- This is similar to the a?b:c operator in C/js: +ans = aBoolValue and 'yes' or 'no' --> 'no' + ``` ## Loops