I have this array and I want to append some new items on click, but first of all I need to get the length of array in order to add the item on right place. This is how array looks like:
"parent": [{
"child": {},
"child2": {},
...
}];
Array needs to look exactly like this and it's empty on page load. I want to insert values in child elements for example:
"parent": [{
"child": {
"0": 1,
"1": 1,
"2": 1
},
...
}];
First of all on start I cannot get length of child array :(
Note that array must look exactly like this and child elements should be in array order from 0 to n.
Everytime I ask for child length I get "undefined" as response. Even if I put manually value ex. "child": {"0": "1", "1": "1"} i got undefined as child length.
.lengthproperty, nor a dependable order.