How can I remove duplicate values from an array. At the end I load the results into a dropdown, but there are many duplicates.
export function dropdownMeets_change(event) {
getMeet()
.then(meet => {
var Sessions = ;
var Teams = ;
//Loop through all the meets in the details.
for ( let i = 0; i < meet.length; i++) {
//if the selected meet is found, add to sessions and teams array
if ($w(“#dropdownMeets”).value === meet[i].meets_id) {
//console.log("IN: " + meet[i].meets_id + " " + meet[i].session + " " + meet[i].teams);
Sessions[i] = {
label: "Session " + meet[i].session,
value: meet[i].id
};
Teams[i] = {
label: meet[i].Teams,
value: meet[i].id
};
}
}
$w("#dropdownSession").options =Sessions;
});
}