I know this is a basic question, but I am trying to create a data structure that is baffling me at the moment.
I have a string array like so:
let stringArray = ['Core', 'Regional'];
And I would like to create this data structure:
[
{'key': 'Core', 'text': 'Core'},
{'key': 'Regional', 'text': 'Regional'}
]
How can I .map over the stringArray to create the data structure above?