:: Forum >>

javascript array grid

Do you have to write out your information for a multi-dimensional array in javascript? i.e.: var array = [ ["1", "2"],
["3", "4"],
];
Or can you form an array (var arr = ["1", "2"]) and then assign it to the first index of another array.

var cells = new Array();
cells[0] = arr;

There seems to be a bug in my code and I'm wondering if it was my array creation. Thanks
Friday, August 4, 2006
var cells = new Array();

is exactly the same as

var cells = [];
Alex (ActiveWidgets)
Tuesday, August 8, 2006
I tried this:

var cells = new Array();
var arr = ["1", "2"]
cells[0] = arr;

It was right

If your code has a bug, I'm sure these lines have nothing to do with it.

But I noticed that your code use "cells" "arr" as variable names, they are too normal, it seems to me that you may use them in other lines or as names of Document Objs, if you do so , it will be a bug.

Best wishes
Jackie.lander@gmail.com
Wednesday, August 16, 2006
thanks for the help
Wednesday, August 16, 2006

This topic is archived.


Back to support forum

Forum search