条件演算子
Sign in to saveAlso known as ternary conditional operator, ?:, inline if, shorthand conditional, ternary operator, ?: operator
ternary operator "x ? y : z" in many programming languages, whose value is y if x evaluates to true and z otherwise
Described at

Conditional (ternary) operator - JavaScript | MDN
The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy. This operator is frequently used as an alternative to an if...else statement.
developer.mozilla.org →Link to a page describing this subject · 8,590 chars · not written by Vinony
Wikidata facts
Show 1 more fact
- described at URL
- www.programiz.com/javascript/ternary-operator
Sources (1)
via Wikidata · CC0
Article · 日本語
条件演算子(英: conditional operator)は、プログラミング言語の演算子で、条件文と同様な意味があるが、文ではなく値を持つ式になる。評価されると、条件式の値により異なる式が評価され、異なる値になる。 なお、C言語やC++など一部のプログラミング言語において、条件演算子とは後述する「? :」(ハテナマークとコロン) の演算子の名称である。
Abstract from DBpedia / Wikipedia · CC BY-SA