I am new to the react, Here I am trying to get the unique elements from the newly created array of object.
const data = _.uniq(
orderData?.Sessions.map(session => ({
label: `${session.Activity.Name}`,
value: `${session.Activity.Name}`
}))
);
I have tried this but, still, it returns me the array of the object which has the unique elements using any of the two keys.
an object should not be duplicated.
can anyone help me with this?