Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove equal objects in list of json js

This was the best solution I could find that makes you able to filter on multiple values in you json object 

    array.filter((thing, index, self) =>
        index === self.findIndex((t) => (
        t.place === thing.place && t.name === thing.name // you can add more arguments here to filter more
      ))
    )

    //Other example
    array.filter((thing, index, self) =>
        index === self.findIndex((t) => (
        t.place === thing.place && t.name === thing.name && t.time === thing.time
      ))
    )
 
PREVIOUS NEXT
Tagged: #remove #equal #objects #list #json #js
ADD COMMENT
Topic
Name
4+3 =