[Object, Object, Object, Object]
[Object, Object, Object, Object]
[Object, Object, Object, Object]
[Object, Object, Object, Object]
[Object, Object, Object, Object]
[Object, Object, Object, Object]
It has several arrays
on one page and I need to count them. Warning: I do not want to use length
to know how many items in each array
and yes how many arrays
For example, in the list above I would return the number 6 (total arrays
).
I have a fixed test array:
$scope.tickets = [{
name: 'Pista Inteira - Lote 01',
items: [{
type: 'Homem',
value: '100,00',
quantity: 0
}, {
type: 'Mulher',
value: '80,00',
quantity: 0
}]
},
{
id: 1,
name: 'Pista (PNE)',
items: [{
type: 'Homem',
value: '100,00',
quantity: 0
}, {
type: 'Mulher',
value: '80,00',
quantity: 0
}]
},
{
id: 2,
name: 'Camarote',
items: [{
type: 'Homem',
value: '100,00',
quantity: 0
}, {
type: 'Mulher',
value: '80,00',
quantity: 0
}]
},
{
id: 3,
name: 'Lounge',
items: [{
type: 'Homem',
value: '100,00',
quantity: 0
}, {
type: 'Mulher',
value: '80,00',
quantity: 0
}]
},
];
I generate this array several times and would like to count how many times this array was generated.
Does anyone know how to do this?