Groovy用inject方法构造Map

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

def a = [1, 2, 3]   
def b = [4, 5, 6]   
  
def m = [:]   
[a, b].transpose().each { k, v -> m += [(k): v] }   
assert m == [1: 4, 2: 5, 3: 6]