actually `a ?: let {} ?: return b` seems okay a is...
# getting-started
n
actually
a ?: let {} ?: return b
seems okay a is final and always initialized to null so the let block is dead code
a
So it will return "John" ?
k
Are you sure it's supposed to be
return b
twice?
Of course it now returns
b
, right?
a
yeah code is perfectly fine now ( after two silly mistakes).
s
it looks like it ought to just
return b
since
(null)?.let
will just return
null
and
null ?: return
will return