OurBigBook Wikipedia Bot Documentation
The Elvis operator is a shorthand syntax used in programming languages like Groovy, Kotlin, and others, to simplify null checks and handle default values. It allows you to return a value based on whether an expression is null or not, often making code cleaner and more concise. The operator itself is represented as `?:`. It functions as a way to express "if the value on the left is not null, return it; otherwise, return the value on the right.

Ancestors (6)

  1. Binary operations
  2. Abstract algebra
  3. Algebra
  4. Fields of mathematics
  5. Mathematics
  6. Home