Below is my javascript code:
var newData =[];
for(var j = 0; j<dates.length;j++){
newData = [[dates[j],close[j]]];
}
document.write(newData[1]);
When I tried to print newData[2] and onwards, it shows undefined.
Only newData[1] shows me the actual value.
Is there anything wrong in the code above ?
I am sure that dates and close array contains all the values needed
document.write!datesandclose. It would also be helpful for you to create a Minimal, Complete and Verifiable Example.newDataarray with each iteration of the loop.