Exerosis
01/08/2022, 8:01 PMvar cancel = false
var i = 0
this.forEach {
if (!cancel) {
val result = !it(using, interaction)
println("${i++} cancelled = $result")
if (result) {
println("cancelling")
cancel = true
}
}
}
So I've got this code, forEach in theory has 11 elements to loop. The 5th element cancels.