Hello I have a 2 variable with object and with a value of array object, in "test" and "test_2" i would like to merge the sku ("test") and feature ("test_2) based on id (as per below). What is the best way to merge, Im thinking of, for the test_2 I convert the feature into value array object ex: feature:[{id:xxx}] first and after that I do the merge, as I try it doesn't work. Hope anyone here can help me. Thank you
const test =
{
sku: [
{id:"282828282", link:"ksksks.com"},
{id:"676867868", link:"lallaa.com"},
{id:"543454554", link:"sssss.com"},
{id:"345473663", link:"fdfsas.com"}
],
}
const test_2 =
{
panels: [
{id:"9328492847", feature: ['282828282']},
{id:"6756734535", feature: ['543454554', '282828282']},
{id:"6545353453", feature: []},
{id:"4353567688", feature: []},
]
}
const test_3 =
{
panels: [
{id:"9328492847", feature: [{id: '282828282', link:"ksksks.com"} ]},
{id:"6756734535", feature: [{id: '543454554', link:"sssss.com"}, {id:'282828282',link:"ksksks.com"}]},
{id:"6545353453", feature: []},
{id:"4353567688", feature: []},
]
}