for an actual block of code you use run
# getting-started
o
for an actual block of code you use run
m
it doesn’t necessarily need to be
run
the important part is that you’re executing something on the event that the left side is null
you can achieve the same result with other stdlib functions… the up side of using
run
is that, in this scenario, the return type is
Unit
o
it is the most useful in this case yes
m
but
apply
would work practically the same
anyway, it doesn’t change the answer, just providing more info
o
Im speaking in Android context here, I am used to seeing apply in this context when they wanna do like
property.setText, propert.setOtherThing....