@laurasweet8888 - this is a very common Lua idiom, though granted that the specific use of it you cite is weird/obscure and I doubt it even does what the author intended! (it will NOT assign nil to “variable” when v=="" as it seems to imply was its intent, see @spheregamestudios rewording of it for a version that would work properly if that’s it’s intended function).
this tends to happen only if you believe that it is truly equivalent to C’s ternary operator - which it isn’t. if you understand what it _ is _, then it operates exactly as expected.
it’s just a boolean expression, so if you replace “CONDITION” with either true/false and evaluate the expansions (“false and false or true”, “true and false or true”), keeping in mind order of operations (and before or) you’ll find they both evaluate true.
then for @laurasweet8888’s specific example, consider that nil evaluates as false in a boolean expression and you’ll see that the OP code probably doesn’t do what it thinks it does. so not only is it obscure, it’s probably broken. (where “probably” means “almost certainly” - I can’t see anything useful that code actually accomplishes beyond “variable = v”)
C’s ternary operator would evaluate only “CONDITION” as the conditional boolean expression. (one of the other two expressions would also be evaluated, but as part of the assignment, not as part of the conditional)