I am using Node.js. I have the following javascript code.
var length=9980;
this.distance= [];//hold distance
this.cost= []; //hold time cost
console.log("before create distance and cost arrays");
console.log("length" + length);
for(var i=0; i < length;i++)
{
console.log("creating cost : " + i );
this.distance[i] = new Array(length);
this.cost[i] = new Array(length);
};
By this, I want to create 2 dimension array of
distance, cost
as shown above.
The problem there is error reported.
Array should be able to hold millions of elements, but there is such error.
What is the problem? How can I make it work?