var enums = {
'1': 'HELLO',
'2' : 'BYE',
'3' : 'TATA'
};
I want to be able to convert that into an array that looks like this,
[
{
number:'1',
word:'HELLO'
},
{
number:'2',
word:'BYE'
},
{
number:'3',
word:'TATA'
}
]
all of the solutions I see form an array of either the keys or the values.
{'1', 'HELLO'}? It is neither valid JavaScript nor valid TypeScript.{number:'2', word: 'TATA'}?