string array to array object javascript 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 }));