How do i use the map function to create an array while excluding duplicate values?
In my app we create an array like this
var commTypes;
commTypes = ourObject.map(function(obj, index) {
return obj.section;
});
It creates an array of obj.sections. Many of the objects in ourObject have the same section and i'd like the array to not have duplicates. Is there a way i can do that within the map function?
I've tried several ways of referencing commTypes inside of the map function, but none have worked.