Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
hmemcpy / introduction6.groovy
Created October 3, 2018 13:44 — forked from peysal/introduction6.groovy
introduction to groovy 1) empty map 2) adding things to map 3) concat map to map 4) iterating
def emptyMap = [:]
assert emptyMap.size() == 0
def notEmptyMap = ["person1":"john", "person2":"mus"]
assert notEmptyMap.size() == 2
notEmptyMap.put "person3","test" //adding to existing one
assert notEmptyMap.size() == 3
notEmptyMap["person4"] = "beth"
assert notEmptyMap.size() == 4