Conditional operator or function for expression syntax
See original GitHub issueDescribe the enhancement
I’d like some kind of conditional operation added to expression syntax. This can be an actual ternary operator (?
:
) or a built-in function (e.g., if(<condition>, <true-value>, <false-value>)
).
Additional information
There is a workaround: using shell scripts to evaluate the condition, setting step outputs, and having other steps reference those outputs. But it would be much cleaner to have some kind of ternary / if/then/else / conditional branching built in to the expression syntax.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:351
- Comments:16
Top Results From Across the Web
the ternary conditional operator
Learn about the C# ternary conditional operator, (`?:`), that returns the result of one of the two expressions based on a Boolean ...
Read more >Ternary conditional operator
In computer programming, the ternary conditional operator is a ternary operator that is part of the syntax for basic conditional expressions in several ......
Read more >Conditional Operator in C
Syntax of a conditional operator · #include <stdio.h> · int main() · { · int age; // variable declaration · printf("Enter your age");...
Read more >Conditional or Ternary Operator (?:) in C
The conditional operator or ternary operator in C is generally used when we need a short conditional code such as assigning value to...
Read more >JavaScript Ternary Operator – Syntax and Example Use ...
The ternary operator is a conditional operator which evaluates either of two expressions – a true expression and a false expression – based...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Syntax:
${{ x && 'ifTrue' || 'ifFalse' }}
fake ternary example
on condition is that your first
<true-value>
must be true for this to workIt seems, although not identical,
<condition> && <true-value> || <false-value>
works in most cases.