array of strings to array of objects code example
Example: convert array of string to array of objects javascript
myArray = myArray.map((str, index) => ({ value: str, id: index + 1 }));
myArray = myArray.map((str, index) => ({ value: str, id: index + 1 }));