我在 JavaScript 中有以下两个数组:
"total":[[1370923200000,"66"],[1371009600000,"42"],[1371096000000,"23"]]
"successful":[[1370923200000,"5"],[1371096000000,"2"],[1371182400000,"0"]]
我想将它们组合成一个数组/对象,看起来像这样:
{date:1370923200000, total:"66", successful:"5"},
{date:1371009600000, total:"42"},
{date:1371096000000, total:"23", successful:"2"},
{date:1371182400000, successful:"0"}
我尝试了多种不同的解决方案,遍历两个数组,但我似乎无法找到一个优雅的解决方案。