Top "Ternary" questions

The base-3 positional numeral system which represents numbers using the digits 0, 1, and 2

Javascript ternary operator and assignment

I get unexpected result for this simple JavaScript assignment statement: var t = 1 == 1 ? 1 : 0; undefined I would have expected to get 1 assigned …

javascript variable-assignment ternary
Java: Ternary with no return. (For method calling)

I was wondering if it was possible to do a ternary operation but without returning anything. If it's not possible …

java methods boolean return ternary
ternary operator in php with echo value

I want to write the following code in ternary operator. I tried in many way but it does not work …

php operator-keyword ternary
Java: avoid checking for null in nested classes (Deep Null checking)

Imagine I have a class Family. It contains a List of Person. Each (class) Person contains a (class) Address. Each (…

java class null ternary
Java Ternary without Assignment

Is there a way to do a java ternary operation without doing an assignment or way to fake the assingment? …

java ternary-operator ternary
?: ternary conditional operator behaviour when leaving one expression empty

I was writing a console application that would try to "guess" a number by trial and error, it worked fine …

c ternary-operator conditional-operator ternary
JAVA calling a method using a ternary operator

I am trying to use ? to decide which method i want to call, but i do not need to assign …

java ternary
Java calling method and using ternary operator and assign in the parameters?

I was reviewing some code and I came across this: public static doSomething(String myString, String myString2) { //Stuff } public static …

java variable-assignment ternary method-call
Multiple Ternary operator in c++

I have a doubt in the following scenario (C++): Say, I have an if condition if ( a ? b ? c : d : …

c++ ternary
Can a JavaScript ternary operator support 3 conditions?

Given the following JavaScript ternary operator, is it possible to enable this to support 3 conditions versus the current two? const …

javascript switch-statement ternary-operator ternary