Beginner Kotlin
Q4 / 100

What does the Elvis operator ?: do?

Correct! Well done.

Incorrect.

The correct answer is C) Returns the left-hand value if non-null, otherwise the right-hand value

C

Correct Answer

Returns the left-hand value if non-null, otherwise the right-hand value

Explanation

The Elvis operator (val result = a ?: b) returns a if it's not null, otherwise returns b.

Progress
4/100