86. JSON.parse() or parse(String str)
Import
·
Jun 07, 2024
·
article
Explanation:-
Creates an object or primitive type from a JSON formatted string.
The JavaScript ES5 native JSON object is used instead of the JSON static methods.
Example:-
var str = ‘{“name”:”George”,”lastname”:”Washington”}’;
var obj = JSON.parse(str);
gs.info(‘The first name is ‘ + obj.name);
Output:-
The first name is George
View original source
https://medium.com/@LearnITbyPrashant/86-json-parse-or-parse-string-str-04511c74ffc4?source=rss-d005fc598f0a------2