just.stringToJSON(string) → {object}
Parses an stringified JSON (
'{"a": 1}') into an object literal ({a: 1}). If you need to parse any other value, use just.parseJSON instead.Parameters:
| Name | Type | Description |
|---|---|---|
| string | Any | Some string to parse. |
Returns:
An object literal.
- Type
- object
Examples
just.stringToJSON('{"a": 1}'); // returns {a: 1}.just.stringToJSON(1); // returns {}.