Yeah I think I have things inverted there....sorry...
# getting-started
p
Yeah I think I have things inverted there....sorry
Copy code
val foo: String? = ""

val bar = foo?.let { thingThatCouldReturnNull() } ?: "Hello"
val baz = if (foo != null) thingThatCouldReturnNull() else "Hello"

println(bar) // "Hello"
println(baz) // "null"