In Node.js, how do I turn a string to a json?
JavascriptJsonHttpnode.jsJavascript Problem Overview
For example, a HTTP REST API just returned me a JSON, but of course it's a string right now. How can I turn it into a JSON?
Javascript Solutions
Solution 1 - Javascript
You need to use this function.
JSON.parse(yourJsonString);
And it will return the object / array that was contained within the string.
Solution 2 - Javascript
use the JSON function >
JSON.parse(theString)