Which line of code is a shorter, more idiomatic version of the displayed snippet?kotlinval len: Int = if (x != null) x.length else -1

🎲 Try a Random Question  |  Total Questions in Quiz: 83  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Kotlin Quiz — practice the complete quiz, review flashcards, or try a random question.

Kotlin MCQs For LinkedIn Skill Assessments.


Which line of code is a shorter, more idiomatic version of the displayed snippet?<br>kotlin<br>val len: Int = if (x != null) x.length else -1<br>