I create a array in Javascript. I want to use the array for key-value pair.
I can successfully add new items and delete items but the length of it is always 0.
Actually the problem I faced is when I want to convert it to a JSON string, it shows empty string: "[]". I just wonder if they are related. And I would also want to know why I cannot convert it.
Below is the debug information, It show the array contain 3 objects but the length is 0. The browser is Firefox 44.0 for Ubuntu.
Thanks!
Fellow @georg idea, I limited the index into 1000 and leave the rest code as before. Everything works including the JSON part. The next picture shows that in my array, there are actual 4 elements, the maximum index is 805.
One thing I learned is that the length of Javascript Array is not the real size but the maximum index number.
The newest finding, the array is really as long as the largest index number. The rest of the element is Null.


objectsinfoshould be an object ({}) instead of an array ([])