I am currently dealing with an array of objects:
myArray = [
{
"edoId": "4010",
"storeName": "ABBEVILLE"
},
{
"edoId": "3650",
"storeName": "AGEN"
},
{
"edoId": "3298",
"storeName": "AIX ALLEES PROVENCALES"
},
{
"edoId": "3309",
"storeName": "AIX JAS DE BOUFFAN"
},
{
"edoId": "3313",
"storeName": "AIX LA PIOLINE"
},
{
"edoId": "2119",
"storeName": "AIX LES BAINS"
},
...
]
I am looking for a way to add an auto-incremental id property to each object in my array, specifically using the forEach method (not by looping with myArray.length).
Any suggestions on how to achieve this?