Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create unique set of array of objects

function unique(array, propertyName) {
   return array.filter((e, i) => array.findIndex(a => a[propertyName] === e[propertyName]) === i);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #unique #set #array #objects
ADD COMMENT
Topic
Name
4+9 =