Evaluating constant when creating dictionary keys

Viewed 74
const myKey: string = 'something'

const myDict: { [id: string]: string } = {
  myKey: 'some value',
}

and I would like the dictionary to look like:

{ 'something' : 'some value' }

but the actual result is:

{ myKey : 'some value' }

How can I force the constant to be replaced by its value when creating the dictionary?

1 Answers
Related