I would like to know the best way to push values from multiple objects to an array while keeping them unique.
For example:
let emails = [];
owners.map(data => {
emails.push(data.mail)
})
members.map(data => {
emails.push(data.mail)
})
console.log(emails)
emails gets populated with the emails from each object, but they are duplicates. I know how to filter an array for duplicates, but I want to see more options for the above code. Thanks!