In Typescript I would like the myObj
variable to be:
{'key01': 'value01'}
So I go ahead with:
let keyName = 'key01';
let myObj = {keyName: 'value01'};
console.log(myObj);
But the resulting variable is
{ keyName: 'value01' }
Can I use the value of the keyName
variable to use as the key name for the variable myObj
?