I have two array and I want to merge this two array and sum the value by date
here are the example arrays
const lz = [
{
date: "2020-05",
value: 100
},
{
date: "2020-06",
value: 200
}
]
const sp = [
{
date: "2020-05",
value: 150
},
{
date: "2020-06",
value: 250
}
]
the result should be the sum of two arrays
const data = [
{ date: "2020-05", value: 250 },
{ date: "2020-06", value: 450 }
]