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 ★
Común · Saberes
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.
En Wikipedia
Texto en inglés Aún no hay artículo en tu idioma: extracto en inglés.
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.
Texto: Wikipedia en inglés, CC BY-SA 4.0. · Imagen: Tzali (CC0) ·
Cartas cercanas
-
Disyunción exclusiva
Operador lógico, xor
Nº Q498186 ★★★
Sin ofertas
-
C
Corchete de Iverson
Nº Q2114682 ★
Sin ofertas
-
J
JSFuck
Esoteric programming language that uses 6 characters to write all JavaScript code
Nº Q25304718 ★
Sin ofertas
-
Disyunción opuesta
Operador logico, nor
Nº Q574946 ★★
Sin ofertas
-
Conjunción opuesta
Negación de la conjunción lógica
Nº Q3874243 ★★
Sin ofertas
-
o
operador booleano
Used when searching to connect words together. The three basic boolean operators are: AND, OR, and NOT. They can help focus a search by connecting information
Nº Q20182284 ★★
Sin ofertas