With all the shorthand ways of doing things in Groovy, there's got to be an easier way to iterate a list while having access to an iteration index.
for(i in 0 .. list.size()-1) {
println list.get(i)
}
Is there no implicit index in a basic for
loop?
for( item in list){
println item
println index
}