Is there any in build function in javascript that let's me convert string "[[16, [8, 2], 4], 2, 80]" to an array of array or int [[16, [8, 2], 4], 2, 80]
Asked
Active
Viewed 48 times
-1
-
1`JSON.pasre("[[16, [8, 2], 4], 2, 80]")` – Mohammad Usman Feb 25 '19 at 06:08
-
1Did you try `JSON.parse()` ? – Hassan Imam Feb 25 '19 at 06:10
-
1@brk Also [this](https://stackoverflow.com/questions/10003706/convert-string-array-representation-back-to-an-array) – Mohammad Usman Feb 25 '19 at 06:11
1 Answers
1
You can use:
JSON.parse("[[16, [8, 2], 4], 2, 80]")

Mohammad Usman
- 37,952
- 20
- 92
- 95

Pelumi
- 413
- 2
- 5
- 13