array of array to array of objects 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 }));