Apologies I know this is a basic question for Senior developers out there, 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'}
]
Please can somebody help me .map over the stringArray to create the datacstructure above? ^