https://kotlinlang.org logo
k

kiku

05/20/2017, 9:43 AM
a return statement always returns from the nearest block.. so if you had something like
fun something(x: List<String>) { x.forEach { ...; return something; }}
, you would be returning from the inner lambda
👍 3
u

umar

05/21/2017, 1:46 AM
kiku: no, by default
return
returns from nearest lexical
fun
keyworded function. So if you want to return from passed lambda use label
return@forEach