How can you remove duplicates in a json object?

  • 0
    "57939542_676854000": {
          "price": "15.95",
          "market_hash_name": "100-Proof Jug",
          "ru_rarity": "Common"
        },
        "57939545_0": {
          "price": "5.00",
          "market_hash_name": "Armor of the Radiant Crusader",
          "ru_rarity": "Common"
        },
        "57939545_679889639": {
          "price": "3.20",
          "market_hash_name": "Armor of the Radiant Crusader",
          "ru_rarity": "Common"
        },
        "57939546_676890580": {
          "price": "4.98",
          "market_hash_name": "Aspect Wraps of the High Plains",
          "ru_rarity": "Uncommon"
        },
        "57939548_0": {
          "price": "2.00",
          "market_hash_name": "Back Hook - Off-Hand",
          "ru_rarity": "Uncommon"
        },
        "57939548_680034817": {
          "price": "3.20",
          "market_hash_name": "Back Hook - Off-Hand",
          "ru_rarity": "Uncommon"
        },
        "57939549_679704489": {
          "price": "2.52",
          "market_hash_name": "Back Hook",
          "ru_rarity": "Uncommon"
        },
        "57939549_3863589862": {
          "price": "5.00",
          "market_hash_name": "Back Hook",
          "ru_rarity": "Uncommon"
        },
        "57939550_0": {
          "price": "2.70",
          "market_hash_name": "Back-Ache",
          "ru_rarity": "Common"
        },
        "57939550_673881884": {
          "price": "4.09",
          "market_hash_name": "Back-Ache",
          "ru_rarity": "Common"
        },
        "57939550_3992208124": {
          "price": "4.80",
          "market_hash_name": "Back-Ache",
          "ru_rarity": "Common"
        }
    JavaScript Anonymous, Jul 25, 2020

  • 2 Answers
  • 0
    Parse the object. Filter data. Pack back.



    If you need simple uniqueness of data within an object, then just calculate the hash for the values ​​of its fields. And if such a hash already exists, exclude the object from the array of objects.
    Anonymous

  • 0
    consider Set
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!