I have two array of objects which are like,
let A = [{id: "1"}, {id: "2"},{id: "3" }]
let B = [{id: "3"}, {id: "2"}]
Now, I am iterating over A.
return _.map(A) => ({
id: A.id,
isAvaliable: //This needs to be like weather B includes A on the basis of ID , means does B object has this A client ID if yes then set it true or false
})
So, final object which I will get will be,
const result = [{
{id: "1", isavaliable: false},
{id: "2", isavaliable: true},
{id: "3", isavaliable: true},
}
]
So, How do I achieve this ? Thanks.