Converts a JSON (JavaScript Object Notation) string into an object.
parse(string, reviver?)
string
A valid JSON string.
reviver optional function(key, value)
A function that transforms the results. It is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
JSON.parse(`{"temperature":20,"humidity":60,"feel":"ok"}`)
{
temperature: 20,
humidity: 60,
feel: "ok"
}
JSON.parse(`"Hello"`)
"hello"