//二维数组转换成对象
var date = [['用户名','密码','租赁期限','缴纳时间'],['遗憾的是','sd就','sdsdsf','jdkcdc']];
var data = [];
var result = {};
for(var a=0; a<date.length; a++) {
var result2 = {}
result['test'+a] = date[a];
for(var j=0;j<date[a].length;j++){
result2['text'+j] = date[a][j];
}
data.push(result2);
}
console.log(data);
01-29
621
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-01
09-29
344
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)