vishnur
06/07/2017, 3:34 AMval ints3 = IntArray(10, { it })
fun returnFromLambda1_1() {
println("This is where the functin starts")
lambdaReturn()
println()
println("This the where the function ends")
}
fun lambdaReturn() {
println("lamdba start")
ints3.forEach {
if (it > 5) {
return
}
print(it)
}
println()
println("lambda end")
}
Result :
OneThis is where the functin starts
lamdba start
012345
This the where the function ends
Refer : after 5 it shoud not print and control flow is given to next function