Kotlin theorytheory 0/50 · 0%
Fundamentals · easy

18. Elvis Operator

Default values for nulls.

The Elvis operator (?:) returns the left-hand side if it's not null, otherwise the right-hand side.

Check your understanding

  1. 1. Syntax for Elvis?

  2. 2. Why is it called Elvis?