Pregunta de entrevista de Simform

If else condition using let in kotlin

Respuesta de la entrevista

Anónimo

29 dic 2020

fun main() { var someValue : String? = null someValue = "SOF" someValue?.let {safeSomeValue-> //This code block will run only if someValue is not null println("then") }?:run { //This code block will run only when if someValue is null, like else condition. println("else") } }