Why Does This Javascript Array Print Out 0?
I have an array called front images written as var frontImages = [];. From what I understand javascript arrays don't need a specified length. When I run the code below, it prints 0
Solution 1:
You're printing the array to the console before the onload functions have executed, and at that time the array is empty, as the images you are waiting for has'nt loaded yet ?
Post a Comment for "Why Does This Javascript Array Print Out 0?"