I'm console logging them in chrome, they appear like this:
(A) []
(B) (3) [{…}, {…}, {…}]
The inside of these arrays is identical when opening them in console. The difference is that I'm hard coding in the values for B and using
arrayA.push({
...
});
on an empty (arrayA = [];)
for array A. Consequently when trying to access the elements in array A, arrayA[0]
it returns undefined, compared to arrayB[0]
which returns the intended value.
EDIT: here is a JSFiddle