I
I
ince2019-02-21 17:36:51
JavaScript
ince, 2019-02-21 17:36:51

What are the JSON conversion tools?

What are the tools (methods from libraries) to convert JSON
FROM:

[
  {"1": "a"},
  {"1": "b"},
  {"1": "c"},
  {"2": "x"},
  {"2": "y"},
  {"2": "z"}
]

AT:
[
  {"1": ["a", "b", "c"]}, 
  {"2": ["x", "y", "z"]}
]

AND FROM:
[
  ["1": "a"],
  ["1": "b"],
  ["1": "c"],
  ["2": "x"],
  ["2": "y"],
  ["2": "z"]
]

AT:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavlo Ponomarenko, 2019-02-21
@TheShock

You have three out of four examples - invalid JSON (valid only the second)
But in general - you can search for all such functions in lodash or google its alternatives.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question