- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:49 AM
Hi
I have simple question. What is the difference between both parsing ways? Output is the same.
var jsonString = '{"var1": "hello","var2":"world"}';
var parsed = JSON.parse(jsonString);
gs.info(parsed.var1)
var jsonString = '{"var1": "hello","var2":"world"}';
var parser = new JSONParser();
var parsedData = parser.parse(jsonString);
gs.info(parsedData.var1)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 02:15 AM
Both can be used to parse a JSON object, and both are present as script includes, you can also check for yourself to better understand this.
Although, JSON Parser that does not use javascript's eval() function. Safe and secure. It does not check for the validity of the JSON string, but shouldn't create any catastrophic errors.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 02:15 AM
Both can be used to parse a JSON object, and both are present as script includes, you can also check for yourself to better understand this.
Although, JSON Parser that does not use javascript's eval() function. Safe and secure. It does not check for the validity of the JSON string, but shouldn't create any catastrophic errors.
Aman Kumar