Hello, all right?
How do I generate a corresponding number for each object, example
{
"api": "api",
"List": [{
"tipo": "1",
"data": "10/10/2017",
"Hora": "11:38",
"Size": "0",
"Nome": "Marcelo"
}, {
"tipo": "1",
"data": "10/10/2017",
"Hora": "11:38",
"Size": "0",
"Nome": "Pedro"
}, {
"tipo": "1",
"data": "10/10/2017",
"Hora": "11:38",
"Size": "0",
"Nome": "Lucas"
}],
"arq": "1",
"paste": "2"
}
I want to generate a number for each name when forEach passes. Example: Marcelo > 0 Peter > 1 Lucas > 2
Every time the forEach passes I want the number to match the order, for example, if the marcelo is in the last it will be 2, and if Lucas stays in first it will be the 0
More or less like this:
B=0; B< obj.List.length ; B++