User talk:JulienDethurens/Essays/Pseudo Ternaries: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>NXTBoy Created page with "==Other forms== {{lua|= ({[true]=x, [false]=y})[condition] (condition and function() return x end or function() return y end)() }} Both of these work when x and y are not tr..." |
>JulienDethurens |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
Both of these work when x and y are not truthy, unlike the standard form.{{User:NXTBoy/sig|date=11:20, 26 March 2012 (UTC)}} | Both of these work when x and y are not truthy, unlike the standard form.{{User:NXTBoy/sig|date=11:20, 26 March 2012 (UTC)}} | ||
:Oh, nice idea. Never thought about doing it that way. I'll add that, though you can add it yourself if you want. --[[User:JulienDethurens|JulienDethurens]] 14:07, 26 March 2012 (EDT) |
Latest revision as of 18:07, 26 March 2012
Other forms
({[true]=x, [false]=y})[condition]
(condition and function() return x end or function() return y end)()
Both of these work when x and y are not truthy, unlike the standard form.
- Oh, nice idea. Never thought about doing it that way. I'll add that, though you can add it yourself if you want. --JulienDethurens 14:07, 26 March 2012 (EDT)