First page Back Continue Last page Overview Image

Syntactic sugar: collections

[1, 2, 3, 4, 5, 6, 7, 8, 9].each { println it * 2 }

def li = [14, 12, 35, 22, -5, 46, 98, 53, 29, 87, 44]

assert li.join("|") == '14|12|35|22|-5|46|98|53|29|87|44'

assert li.size() == 11

assert li.min() == -5

assert li.max() == 98

assert li.sum() == 435