SyntaxFix
Write A Post
Hire A Developer
Questions
Replace each loop with any closure.
def list = [1, 2, 3, 4, 5] list.any { element -> if (element == 2) return // continue println element if (element == 3) return true // break }
Output
1 3