I can't get the amount that is inside counter, that is, it should show me two, since I have counter_1 and counter_2 , how do I always get the amount and then be able to go through it with a for loop.
counter = {
counter_1: {
counter_name: 'contador1'
},
counter_2: {
counter_name: 'contador2'
}
}
ALREADY TRIED WITH
alert(counter.length);
You can do the following:
The above will give us this result:
length
to the newly filled vectorfull example
You can use a for in loop:
Or the keys method of Object: