Operations ‣ Rules ‣ Utilities ‣ Tools ‣ decodeConditions
A powerful function to “rekey” to a fixed set of conditions.
-
condition_xis the condition. -
toReplace_xis the value returned ifcondition_xis evaluated as True.
If none of the condition_x’s are evaluated as True, fallback will be returned (or an empty text,
if no fallback was defined.
Examples:
- if $(‘a’) is 1 :
decodeConditions($('a') > 10, "yes", $('a') < 5, 'no')→ “no” - if $(‘a’) is 11 :
decodeConditions($('a') > 10, "yes", $('a') < 5, 'no')→ “yes” - if $(‘a’) is 6 :
decodeConditions($('a') > 10, "yes", $('a') < 5, 'no', "maybe")→ “maybe” - if $(‘a’) is 6 :
decodeConditions($('a') > 10, "yes", $('a') < 5, 'no')→ “”