In which task and step of the codelab can this issue be found?
9
Describe the problem
Here says "Note: The ?: Elvis operator returns the expression that precedes it if the value isn't null and the expression that proceeds it when the value is null. It lets you write this code more idiomatically. For more information, see Elvis operator."
But when you click on the link, you see that:
If the expression to the left of ?: is not null, the Elvis operator returns it, otherwise it returns the expression to the right. Note that the expression on the right-hand side is evaluated only if the left-hand side is null.
Steps to reproduce?
Go to...
Click on...
See error...
VersionsAndroid Studio version:API version of the emulator:
Additional informationInclude screenshots if they would be useful in clarifying the problem.
@rdhpn
Thank you for reaching out to us.
The codelab seems to explaining the same Kotlin definition differently.
Could you please explain us the issue further?
URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-using-state?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-using-state#8
In which task and step of the codelab can this issue be found?
9
Describe the problem Here says "Note: The ?: Elvis operator returns the expression that precedes it if the value isn't null and the expression that proceeds it when the value is null. It lets you write this code more idiomatically. For more information, see Elvis operator." But when you click on the link, you see that: If the expression to the left of ?: is not null, the Elvis operator returns it, otherwise it returns the expression to the right. Note that the expression on the right-hand side is evaluated only if the left-hand side is null.
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.