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..."
 
>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..."
(No difference)

Revision as of 11:20, 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.

11:20, 26 March 2012 (UTC)