To embed this script in your site, just drop the content below where you want to embed it.
def x = [1,2,3].inject([:]) { map, it -> [*:map, (it): it <= 2 ? 'safe' : 'charm'] } assert x == [1: 'safe', 2: 'safe', 3: 'charm']