请教下大神,不同长度数组合并问题?
arr1 = [
{uid:"111111",name:"test1"},
{uid:"222222",name:"test2"},
{uid:"333333",name:"test3"},
{uid:"444444",name:"test4"},
{uid:"555555",name:"test5"},
]
arr2 = [
{uid:"111111", score:100},
{uid:"222222", score:80},
{uid:"333333", score:85},
{uid:"444444", score:95},
]
想要合并成一个新的数组,uid没有分数据用0填充,如何在小程序的 js里面实现? 实现结果: arr3 = [
{name:"test1",score:100},
{name:"test2",score:80},
{name:"test3",score:85},
{name:"test4",score:95},
{name:"test5",score:0},
]