Groovy web console

subscribe to the feed Subscribe
to this
site

maps

Published 3 months ago by manoj with tags resolve
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def map1 = [:]
def map2 = [status:"active", name:"manoj"]


if(!map1["status"]){
println "creating empty list" 
map1["status"]=[]
}
map1["status"].add(map2 )

def map3 = [status:"dead", name:"xyz"]
if(!map1["status"]){
println "creating empty list" 
map1["status"]=[]
}
map1["status"].add(map3 )
println map1