Ternary operator?
See original GitHub issueOne kinda annoying usecase are lambdas with just one if like:
GroupEnum(g, p, Filter(() -> begin
if GetFilterUnit().getTypeId() == 'z000'
...
else
...
end))
which requires the begin/end keywords I would prefer a 1line solution
GroupEnum(g, p, Filter(() -> if GetFilterUnit().getTypeId() == 'z000' then ... else ...))
which should still allow linebreaks inside it for readability. Ideally also working without else case for lambdas. and also this maybe https://github.com/peq/WurstScript/issues/464
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Conditional (ternary) operator - JavaScript - MDN Web Docs
The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?)
Read more >Ternary conditional operator - Wikipedia
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 >the ternary conditional operator - Microsoft Learn
The conditional operator ?: , also known as the ternary conditional operator, evaluates a Boolean expression and returns the result of one ...
Read more >Java Ternary Operator with Examples - GeeksforGeeks
Java ternary operator is the only conditional operator that takes three operands. It's a one-liner replacement for the if-then-else ...
Read more >Make Your Code Cleaner with JavaScript Ternary Operator
This tutorial shows you how to use the JavaScript ternary operator as the shortcut of the if-else statement to make your code cleaner....
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
Yes, you could do something stupid like this:
But you should not 😉
Why, though, is there any problem with ? and :? Or did you plan to use it for something else? The way I see it ? : should be pretty decent.