groovycode.com

Groovy reverseEach

Reverse a groovy list an manipulate every entry.

1 def list = [1,2,3]
2 def result = []
3 list.reverseEach {
4     result << it * 2
5 }