07-20-2023, 08:17 AM
Given the following lambda:
val lambda: () -> Unit = null
Which of the following calls is idomatic to Kotlin for calling a nullable lambda?
lambda?.let { it() }
vs
lambda?.invoke()
val lambda: () -> Unit = null
Which of the following calls is idomatic to Kotlin for calling a nullable lambda?
lambda?.let { it() }
vs
lambda?.invoke()