Let’s say I have
def A = "abc"
def X = "xyz"
how do I create a Map where, instead of
def map = [A:1, X:2]
I get instead the equivalent of writing
def map = [abc:1, xyz:2]
but can use a variables A and X for the key?
P.S.: Same question for the value part of the map.
Use this:
For the value-part it’s even easier, since there is no automagic “convert text to string” happening: