Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

js check if array of objects contains duplicates


const arrayOfObjCopy = [...arrayOfObj];

Object.keys(arrayOfObjCopy).forEach((key) => {
  arrayOfObjCopy[key] = JSON.stringify(arrayOfObjCopy[key]);
 });

const arrayOfObjhasDuplicates = uniq(arrayOfObjCopy).length != arrayOfObjCopy.length;
 
PREVIOUS NEXT
Tagged: #js #check #array #objects #duplicates
ADD COMMENT
Topic
Name
9+3 =