我有一个数组:
data = [ {date: 4/15/2020, 9:46:07 PM, value: "abc"},
{date: 4/15/2020, 11:19:18 PM, value: "xyz"},
{date: 4/16/2020, 1:25:13 PM, value: "def"},
{date: 4/17/2020, 5:6:17 PM, value: "pqr"}
];
我必须比较日期对象并合并数组。
因此,预期的输出如下所示:
data = [ {date: 4/15/2020, value: ["abc", "xyz"]},
{date: 4/16/2020, value: ["def"]},
{date: 4/17/2020, value: ["pqr"]}
];
我怎样才能做到这一点?
提前致谢!!
莫回无
倚天杖
子衿沉夜
相关分类