Fundamentals14 / 14
Up next

Ternary with and/or

-- Lua has no ?: ; `cond and a or b` fills the role
local n = 4
local label = (n % 2 == 0) and "even" or "odd"
print(label)
What you're solving

cond and a or b picks a value inline