@zerkms, is correct. But I also wanted to indicate why this is happening.
> var temp = []; > temp[10] = 'test'; > temp [ , , , , , , , , , , 'test' ]
As you can see, it creates 9 undefined values. I ran above with nodejs, so null values ββare not displayed.
If I made JSON.stringfy (), you will see:
> JSON.stringify(temp) '[null,null,null,null,null,null,null,null,null,null,"test"]'
source share