I have an array made of unlimited number of objects. These objects have the same structure. If I console.log my whole array I get something like this:
[object], [object], [object], ecc…
Whenever I push a new object inside of the array I could also implement a counter, or I could just use a normal for loop to count the objects. Isn’t there any more efficient way to count all the objects?
Why does array.lenght not work?
array.lengthreturns the number of elements stored inside an array.