I am working on scraping part and i am getting the data well, but when I am iterating the array and trying to get the data throwing me TypeError: Cannot read property '3' of undefined
My code is:
$('table#blob1 tr.insRow').filter(function(){
var data = $(this);
i = i + 1;
bow_arr[i] = new Array(6);
bow_arr[i][1] = data.children(1).text();
bow_arr[i][2] = data.children(2).text();
bow_arr[i][3] = data.children(3).text();
bow_arr[i][4] = data.children(4).text();
bow_arr[i][5] = data.children(5).text();
bow_arr[i][6] = data.children(6).text();
})
Here i am creating two dimensional array and inserting the data into it. and i am able to get all the children values correctly and i have inserted all those data into the two dimensional array.
The filter function runs for 5 times since it is encountered five times.
for(i=0;i<1;i++){
console.log(bow_arr[i][3]+" - "+bow_arr[i][4]);
}
The above code i am just trying to print the values but i am getting TypeError like this. TypeError: Cannot read property '3' of undefined
0.new Array(6)notation nowadays. It's lengthy and it's easy to use it wrong inadvertently. Just[]will do.