Elvis operator
Binary operator in computer programming
In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns the first operand if its value is logically true (according to a language-dependent convention, in other words, a truthy value) or returns its second operand if the first operand is not true. That is, it is a short-circuit OR, which returns its first truthy operand.
Nº Q22682021 ★
Commune · Savoirs
Elvis operator
Binary operator in computer programming
In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns the first operand if its value is logically true (according to a language-dependent convention, in other words, a truthy value) or returns its second operand if the first operand is not true. That is, it is a short-circuit OR, which returns its first truthy operand.
Sur Wikipédia
Texte en anglais Pas encore d'article dans ta langue : extrait en anglais.
In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns the first operand if its value is logically true (according to a language-dependent convention, in other words, a truthy value) or returns its second operand if the first operand is not true. That is, it is a short-circuit OR, which returns its first truthy operand. The syntax of the Elvis operator was inspired by the ternary conditional operator, ? :, since the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional expression A ? A : B. It is called the "Elvis operator" because the notation ?:, when viewed sideways, resembles an emoticon of Elvis Presley with his signature hairstyle. A similar operator is the null coalescing operator, where the boolean truth(iness) check is replaced with a check for non-null instead. This is usually written ??, and can be seen in languages like C# or Dart.
Texte : Wikipédia en anglais, CC BY-SA 4.0. · Image : Tzali (CC0) ·
Cartes voisines
-
Fonction logique OU exclusif
Opérateur logique de l'algèbre de Boole
Nº Q498186 ★★★
Pas en vente
-
C
Crochet d'Iverson
Nº Q2114682 ★
Pas en vente
-
J
JSFuck
Esoteric programming language that uses 6 characters to write all JavaScript code
Nº Q25304718 ★
Pas en vente
-
Fonction logique NON-OU
Opérateur logique de l'algèbre de Boole
Nº Q574946 ★★
Pas en vente
-
Barre de Sheffer
Opérateur logique
Nº Q3874243 ★★
Pas en vente
-
o
opérateur booléen
Utilisé pour combiner des mots ensemble lors d'une recherche d'information
Nº Q20182284 ★★
Pas en vente