Read and parse JSON in JavaScript

access_time 2 years ago visibility18 comment 0

JSON is commonly used in modern applications for data storage and transfers. Pretty much all programming languages provide APIs to parse JSON. 

JSON means JavaScript Object Notation. So of course we can easily parse JSON string in JavaScript.

JSON.parse function can be used to parse JSON in JavaScript.

Code snippet

var json = '{"Name":"A","Value":2}';
jsonObj = JSON.parse(json);
console.log(jsonObj.Name);
console.log(jsonObj.Value);
info Last modified by Raymond at 2 years ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Want to publish your article on Kontext?

Learn more

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.


Learn more arrow_forward

More from Kontext

Bootstrap 4 Mega Full Width Dropdown Menu

local_offer HTML local_offer Javascript local_offer bootstrap

visibility 1129
thumb_up 1
access_time 5 months ago

On Kontext, a full width mega dropdown menu is implemented using Bootstrap 4. If you'd like to implement similar menus, please follow these steps.  The following code snippets work with Bootstrap 4.4.1. It should also work with other 4.x versions but I didn't test it.  The new CSS class ...

local_offer node.js local_offer Javascript

visibility 1617
thumb_up 1
access_time 7 months ago

After upgrading Visual Studio to 16.5.1, I encountered the following error in Task Runner Explorer: ***\Kontext.Web.Portals\node_modules\node-sass\lib\binding.js:15 throw new Error(errors.missingBinary()); ^ Error: Missing binding ...

local_offer Javascript

visibility 402
thumb_up 0
access_time 11 years ago

前几天帮一个学弟写的,JavaScript版本的杨辉三角,其实和其他C、Java等等版本的都差不多。代码如下:

About column

Code snippets for various programming languages/frameworks.

rss_feed Subscribe RSS