Groovy web console

subscribe to the feed Subscribe
to this
site

non unique keys

Published 3 weeks ago by rpowell
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def mymap = [:]
for (int i ; i< 10 ; i++){
    def loopvar$i 
    loopvar$i= "thing"
    mymap[loopvar$i] = i
}
print "${mymap}"