DEV Community

Discussion on: Which types of loops are most popular in the programming languages you use?

jcoelho profile image
José Coelho • Edited on

With Groovy I use closures inside the each() or eachWithIndex() methods.
You can even build the closure before hand and store it in a variable. Really cool:

Closure cl = { person ->

List<Person> people = [...]


check out my article on Groovy 😄