我对 Javascript 很陌生,想在数组中交换数组的项目。例子:
{
"data": [
[null, 1353064450],
[null, 1353064460],
[null, 1353064470],
[null, 1353064480],
[null, 1353064490]
],
"label": "cpu"
}
应该变成:
{
"data": [
[1353064450, null],
[1353064460, null],
[1353064470, null],
[1353064480, null],
[1353064490, null]
],
"label": "cpu"
}
我可能必须遍历数组并创建一个新数组?任何指针都会很棒!