to do almost anything. 2. It's probably optional. semi-colons typing parenthesis around parameters return statements 3. By default, the last command executed is what's returned.
int answer = 0 for (i in [1,2,3,4,5,6,7,8,9,10]) { answer += i } println answer option2: int answer = 0 (1..10).each { answer = answer + it } println answer Bonus answer: (1..10).sum()