```var cancel = false var i = 0 this.forEach { ...
# server
e
Copy code
var 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.
🧵 3