Is there a way to define the parameters for a Map
in such a manner that each key is linked to a value containing the key as a specific property's value? To clarify, consider this example:
const example = {
'a': {
specialKey: 'a',
aField: 'specific thing to a'
},
'b': {
specialKey: 'b',
bField: 'specific thing to b'
}
}
In the provided example, I aim to specify that for the key a
, the value of specialKey
should be a
.