Here is an array containing different strings:
let myArray : ["AA","BB" , "CC" ...]
My goal is to transform it into an array of objects:
myArray = [{"id":1 , "value": "AAA"},{"id":2 , "value": "BBB"},{"id":3 , "value": "CCC"}...]
I attempted to achieve this using a "for loop":
for (let obj of ListObj) {
let resObj = {};
resObj ['value'] = obj ;
equipment = resObj ;
}
I also tried with the map method:
ListObj.map(obj => { 'value' = obj })
Any suggestions on how else I could accomplish this task?