A
A
Andrey2016-12-10 20:57:59
JavaScript
Andrey, 2016-12-10 20:57:59

How to remove duplicates from json?

There is a json file

"ЛуАЗ": [
    "1302 Волынь",
    "967",
    "969"
  ],
  "Москвич": [
    "2137",
    "2138",
    "2140",
    "2141",
    "400",
    "401",
    "402",
    "403",
    "407",
    "408",
    "410",
    "412",
    "423",
    "424",
    "427",
    "Князь Владимир",
    "Святогор",
    "Юрий Долгорукий",
    "2136",
    "2137",
    "2138",
    "2140",
    "2141",
    "400",
    "401",
    "402",
    "403",
    "407",
    "408",
    "410",
    "411",
    "412",
    "423",
    "424",
    "426",
    "427",
    "Дуэт",
    "Иван Калита",
    "Князь Владимир",
    "Святогор",
    "Юрий Долгорукий"
  ],

how to remove duplicates inside arrays?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2016-12-10
@svistiboshka

https://jsfiddle.net/yarkov_aleksei/yb4x5ru3/4/

D
Dmitry Belyaev, 2016-12-11
@bingo347

arr = Array.from(new Set(arr));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question