两个存在相同键值的数组怎么进行分组合并?
数组一:
tabs:[
{day: '11-01', dayofweek: '周一'},
{day: '11-02', dayofweek: '周二'},
{day: '11-03', dayofweek: '周三'},
]
数组二:
datas:[
[
{isday: '11-01', dosomsing: '吃饭'},
{isday: '11-01', dayofweek: '上班'}
],
[
{isday: '11-02', dayofweek: '旅游'},
{isday: '11-02', dayofweek: '开车'},
{isday: '11-02', dayofweek: '上山'}
],
[
{isday: '11-03', dosomsing: '睡觉'},
{isday: '11-03', dayofweek: '躺平'}
]
]
我想要达到的结果:
newTabs:[
{day: '11-01',
dayofweek: '周一',
datas:[
{isday: '11-01', dosomsing: '吃饭'},
{isday: '11-01', dayofweek: '上班'},
]},
{day: '11-02',
dayofweek: '周二',
datas:[
{isday: '11-02', dayofweek: '旅游'},
{isday: '11-02', dayofweek: '开车'},
{isday: '11-02', dayofweek: '上山'},
]},
{day: '11-03',
dayofweek: '周三',
datas:[
{isday: '11-03', dosomsing: '睡觉'},
{isday: '11-03', dayofweek: '躺平'},
]},
]
这个怎么实现?