Namespace: stringToJSON

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.
Source:
stringToJSON.js, line 20

Parameters:

NameTypeDescription
string
AnySome string to parse.

Returns:

An object literal.
Type
object

Examples

Example 1.
just.stringToJSON('{"a": 1}'); // returns {a: 1}.
Example 2.
just.stringToJSON(1); // returns {}.