I have a multidimensional array of 100 trucks. Each truck holds several boxes. I insert the first box of each truck by splicing from the box array to the truck array:
removed = allBoxes.splice(x, 1)[0];
trucks[i] = {0: removed};
Because I know it's the first box, I can put the {0:. But to add the next box, I want it to be dynamic.
I can insert it at the right place, but the key is undefined instead of 1 for the next box.
removed = allBoxes.splice(x, 1)[0];
trucks[i][trucks[i].length] = removed;
You can see the results here: Instead of undefined:, can it say 1? Whenever I try to add a variable in the array, it just writes out the variable string, not the value.

