开发者

Basic question on Array and Objects

开发者 https://www.devze.com 2023-02-25 03:00 出处:网络
var data = [row,row2]; This is an Array containing two objects. Can i place some thing like this. var data = [rowData,row2];
var data = [row,row2];

This is an Array containing two objects. Can i place some thing like this.

var data = [rowData,row2];

Where rowData is an Array containing Objects. How can i make rowData behave like an Object like rowData[0],rowData[1] etc e开发者_C百科tc... with in the data Array.


i think you mean:

var data = [rowData,row2];
//access rowdata:
data[0][1]...

or you can use a json object:

var data = {
     rowData: rowData,
     row2: row2
};
//access rowData:
data.rowData[1]...


Certainly, arrays can contain arrays.

0

精彩评论

暂无评论...
验证码 换一张
取 消