Top "Ternary-operator" questions

The conditional operator is a ternary operator that is part of the syntax for a basic conditional expression in several programming languages.

How to write a PHP ternary operator

How do I write a PHP ternary operator with the elseif portion? I see basic examples with the if and …

php ternary-operator
The ternary (conditional) operator in C

What is the need for the conditional operator? Functionally it is redundant, since it implements an if-else construct. If the …

c operators ternary-operator conditional-operator
Ternary operation in CoffeeScript

I need to set value to a that depends on a condition. What is the shortest way to do this …

javascript coffeescript ternary-operator
doing comparison if else in JasperReports

I want to do a comparison such as: if <field> == 0 then "-" Can somebody tell me the syntax …

jasper-reports ternary-operator
Ternary in Laravel Blade

Looking for a ternary operator for blade templates @if(Auth::check()) ? yes : no @endif Can't seem to get it to …

laravel ternary-operator blade
Assign only if condition is true in ternary operator in JavaScript

Is it possible to do something like this in JavaScript? max = (max < b) ? b; In other words, assign value …

javascript ternary-operator
Ternary operator in JSTL/EL

The following tag of JSTL can be used to set a value to a variable in a request scope. <…

jsp jstl el ternary-operator conditional-operator
Compressing `x if x else y` statement in Python

I'm quite acquainted with Python's ternary operator approach: value = foo if something else bar My question is very simple: without …

python variable-assignment ternary-operator user-friendly
If without else ternary operator

So far from I have been searching through the net, the statement always have if and else condition such as …

java if-statement ternary-operator
How do you use the Optional variable in a ternary conditional operator?

I want to use an Optional variable with the ternary conditional operator but it is throwing error this error: optional …

swift ternary-operator