Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
Source by flexiple.com #
 
PREVIOUS NEXT
Tagged: #js #check #array #objects #duplicates
ADD COMMENT
Topic
Name
2+5 =