Groovy web console

subscribe to the feed Subscribe
to this
site
Untitled (via #groovywebconsole)
tweet this snippet Tweet
this
script

Untitled

Published 11 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def names = ['alpha', 'beta', 'gamma'];
def temps = [12, 65, 78];

def indexes = temps.findIndexValues{ it > 64 }.collect{(Integer)it};
def results = indexes.collect { "${names[it]} ${temps[it]}" }

results.each { println it }