mozilla

Compare Revisions

JSON.parse()

Change Revisions

Revision 480989:

Revision 480989 by madarche on

Revision 480993:

Revision 480993 by madarche on

Title:
JSON.parse
JSON.parse
Slug:
Web/JavaScript/Reference/Global_Objects/JSON/parse
Web/JavaScript/Reference/Global_Objects/JSON/parse
Tags:
"JSON"
"JSON"
Content:

Revision 480989
Revision 480993
tt96try {
96var transformed =97    var transformed =
97  JSON.parse('{"p": 5}', function(k, v) { if (k === "") return v;98        JSON.parse('{"p": 5}', function(k, v) { if (k === "") ret
> return v * 2; });>urn v; return v * 2; });
98// transformed is { p: 10 }99    // transformed is { p: 10 }
100} catch (e) {
101    console.error("Parsing error:", e); 
102}

Back to History