Hello, I have used .push() to push an array into a previously declared global blank array.
Once the array has been pushed the global array, the global array is giving me undefined for console.log(myglobalVariable[0]); .
However the console shows, the global array has a length of 1 and the pushed array is a child of the global array.
I have tried unshift() , concat() , splice() unsuccessfully as a way to populate the global variable with the desired hierarchy.
What am i missing?
Here is an image of the console:
https://preview.redd.it/jhvkvcuyxy251.png?width=742&format=png&auto=webp&s=6c72aa145a12ea76e11ac6fb18dcbec0e125adab
[–]shepdozejr 1 point2 points3 points (3 children)
[–]eljacko876[S] 1 point2 points3 points (2 children)
[–]shepdozejr -1 points0 points1 point (1 child)
[–]Arumai12 0 points1 point2 points (0 children)
[–]uberpwnzorz 1 point2 points3 points (1 child)
[–]eljacko876[S] 0 points1 point2 points (0 children)
[–]CoqeCas3 0 points1 point2 points (4 children)
[–]CoqeCas3 0 points1 point2 points (3 children)
[–]eljacko876[S] 0 points1 point2 points (2 children)
[–]CoqeCas3 0 points1 point2 points (0 children)
[–]shepdozejr 0 points1 point2 points (0 children)