Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to check duplicate objects in array and remove in angular

var filterArray = courseArray.reduce((accumalator, current) => {
    if(!accumalator.some(item => item.id === current.id && item.name === current.name)) {
      accumalator.push(current);
    }
    return accumalator;
},[]);
console.log(filterArray)
Source by www.cloudhadoop.com #
 
PREVIOUS NEXT
Tagged: #check #duplicate #objects #array #remove #angular
ADD COMMENT
Topic
Name
1+9 =