That is where you use optional chaining + extension method. And that is basically identical to Optional.map or whatever method in those language with Optional type
in kotlin
func add3 (val: Int?) = val ?.let { it + 3 }
The language gives you a way to say: `this value plus 3 if it exist or just return null`
Unfortunately, there is no such method in js currently, so it looks half baked.
in kotlin
The language gives you a way to say: `this value plus 3 if it exist or just return null`Unfortunately, there is no such method in js currently, so it looks half baked.