I don't understand foreach{ } in kotlin. help me ! thanks you

fun f1() {
(1…4).forEach {
if (it == 2) return
print(it)
}
}

fun f2() {
(1…4).forEach(fun(it) { // closure
if (it == 2) return
print(it)
})
}

fun main(args: Array) {
f1()
f2()
}

non-local return