Duplicate Query:
how to parse json in javascript
The data sent back by my server is in JSON format, but it doesn't follow the usual key/value pairs structure.
Here's an example of the data I'm receiving:
["Value1","Value2","Value3"]
My question is - is there a commonly used library that can be used to parse this data and extract only the String values Value1
, Value2
, and Value3
?
Currently, I have a code block that replaces characters such as [
, ]
, and "
and then split on ","
. This method feels clumsy and I'm looking for a more elegant solution.