How can I combine both arrays (profile and countries), but filter any objects where the Name is the same in both arrays (but only remove the object that has IsDirector: null)
I'm guessing it's a combination of concat & filter but not sure how to get it working.
Data:
let profile = [
{
"IsDirector":true,
"Name":"Germany"
},
{
"IsDirector":false,
"Name":"Spain"
},
]
let countries = [
{
"IsDirector":null,
"Name":"Germany"
},
{
"IsDirector":null,
"Name":"Spain"
},
{
"IsDirector":null,
"Name":"Portugal"
}
]
Desired result:
[
{
"IsDirector":true,
"Name":"Germany"
},
{
"IsDirector":false,
"Name":"Spain"
},
{
"IsDirector":null,
"Name":"Portugal"
}
]