Elvis operator(?:) is named after its resemblance to Elvis Presley's famous hair. Even though it is not the "king" of operators, the operator is present in many languages such as C, Kotlin, Groovy, and Cold Fusion. You can use this operator to safeguard against null values and to provide default assignment values when the primary option fails.
x = a ? : b
//is equivalent to the
following expression:
x = if(a == null) b else a