Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Kotlin
/
Scope functions
For value of type String?, which statement about value.let and value?.let is correct?
from Scope functions
Kotlin 2.4.10
intermediate
1 min
For value of type String?, which statement about value.let and value?.let is correct?
value.let always invokes the block with a String?; value?.let skips it for null and supplies a non-null String otherwise.
Both forms skip the block when value is null.
let rejects nullable receivers at compile time.
value?.let invokes the block once with null before returning.
Check
Ask AI about this kata
Report an error
next kata
What does lookup("known") print when the receiver exists but the let block returns null?
Predict the output
A new version is available
Reload