About 6,680,000 results
Open links in new tab
  1. How do I use the conditional (ternary) operator? - Stack Overflow

    The ternary operator ? is a way of shortening an if-else clause, and is also called an immediate-if statement in other languages (IIf(condition,true-clause,false-clause) in VB, for example).

  2. How do you use the ? : (conditional) operator in JavaScript?

    Jun 7, 2011 · The conditional (ternary) operator is the only JavaScript operator that takes three operands. This operator is frequently used as a shortcut for the if statement.

  3. Ternary operator: bad or good practice? - Stack Overflow

    Which ternary operator are you talking about? A ternary operator is any operator that takes three arguments. If you're talking about the ? : operator, this is called the conditional operator. I can't …

  4. syntax - Ternary operator (?:) in Bash - Stack Overflow

    @dutCh's answer shows that bash does have something similar to the "ternary operator" however in bash this is called the "conditional operator" expr?expr:expr (see man bash goto section …

  5. Ternary operator in PowerShell - Stack Overflow

    Jul 10, 2015 · From what I know, PowerShell doesn't seem to have a built-in expression for the so-called ternary operator. For example, in the C language, which supports the ternary …

  6. javascript - OR in ternary operator, using && - Stack Overflow

    Jul 6, 2018 · That's not a ternary operator (an operator accepting three operands). That's two binary operators (|| and && -- operators accepting two operands). JavaScript currently has …

  7. JavaScript shorthand ternary operator - Stack Overflow

    I know that in PHP 5.3 instead of using this redundant ternary operator syntax: startingNum = startingNum ? startingNum : 1 ...we can use a shorthand syntax for our ternary operators …

  8. To ternary or not to ternary? [closed] - Stack Overflow

    The ternary operator can be used in places where the if..else construct can't, for example in return statements, and as function arguments. The same could be achieved without ternary use, but …

  9. Multiple conditions in ternary conditional operator?

    Sep 23, 2012 · Multiple conditions in ternary conditional operator? Asked 13 years, 1 month ago Modified 5 years, 7 months ago Viewed 230k times

  10. java - Ternary Operator - Stack Overflow

    Sep 23, 2022 · 3 The ternary operator can be used to combine two expressions but an empty statement is not an expression.