logo

NJP

ServiceNow Things to Know 76: JSON.parse() or parse(String str)

Import · Jan 08, 2024 · article

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

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

Best Regards,

Prashant Kumar (LearnIT)

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635

View original source

https://www.servicenow.com/community/developer-blog/servicenow-things-to-know-76-json-parse-or-parse-string-str/ba-p/2783662