Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function removeDuplicateObjects(arrayOfObjects) {
  2.  
  3. let newObj = new Set();
  4.  
  5. arrayOfObjects.forEach(item => newObj.add(JSON.stringify(item)))
  6.  
  7. return Array.from(newObj).map(item => JSON.parse(item))
  8.  
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement