[[+content_image]]
V
V
Vernal962017-01-20 16:08:30
JavaScript
Vernal96, 2017-01-20 16:08:30

How to convert JSON multidimensional string array to JS multidimensional array?

The following response comes from the server:

[[{"key":"value","key":"value"}],[{"ID":"1","NAME":value","PARENT_NAME":"value","DIR_NAME": "value","IMAGE":value"},{"ID":"2","NAME":"value","PARENT_NAME":"value","DIR_NAME":"value","IMAGE":" value"}]]

How can I convert this array into the corresponding JS array?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexey Yarkov, 2017-01-20
@Vernal96

Marvelous )))

var json_str = '[[{"key":"value","key":"value"}],[{"ID":"1","NAME":value","PARENT_NAME":"value","DIR_NAME":"value","IMAGE":value"},{"ID":"2","NAME":"value","PARENT_NAME":"value","DIR_NAME":"value","IMAGE":"value"}]]';
console.log(JSON.parse(json_str));

V
Vernal96, 2017-01-20
@Vernal96

Thanks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question