Groovy web console

subscribe to the feed Subscribe
to this
site

Iterate over list values

Published 2 years ago by Valentin
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
void doSomething(String x){ println(x) }
def items = ["aa", "bb", "cc"];

items.each { x -> doSomething(x) }
"Done."