Supposed i have two array
// item01
[
{ value: "0", value: "01", display: "Jamsheer", key: "jam" },
{ value: "1", value: "02", display: "Muhammed", key: "muh" },
{ value: "2", value: "03", display: "Ravi", key: "rav" },
{ value: "3", value: "04", display: "Ajmal", key: "ajm" },
{ value: "4", value: "05", display: "Ryan", key: "rya" }
]
// item02
[
{ value: "0", value: "01", display: "Kamal" },
{ value: "1", value: "02", display: "Jamal"},
]
The final result I need is the difference between these arrays using id & value and show item02: display, ID & item01: key – the final result should be like this:
[
{ value: "0", value: "01", display: "Kamal", key: "jam"},
{ value: "1", value: "02", display: "Jamal", key: "muh"},
]
i tried filter with some method but it didn't solved my problem. Is it possible to do something like this using reduce in JavaScript?
valuetwice