我想添加行
['2008',777,333]
to var fun并维护结构:
var fun = [
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
];
使用push或concat似乎破坏了结构。可以这样做吗?
答案 0 :(得分:0)
fun.push(['2008', "1033", "554"]) //to add whole row
fun[2].push('555') // to add item into row 3 as the last item