Read and parse JSON in JavaScript

access_time 2 years ago visibility22 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 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

Follow Kontext

Get our latest updates on LinkedIn or Twitter.

Want to publish your article on Kontext?

Learn more

More from Kontext

visibility 8
thumb_up 0
access_time 1 month ago

In Visual Studio projects, Gulp can be used to manage web application client resources such as CSS, fonts, JavaScript files and images and so on. This article provides guidance about download Google fonts into your project automatically via Gulp as part of project build or pre-publish. Node.js ...

visibility 22
thumb_up 0
access_time 2 years ago

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

Bootstrap 4 Mega Full Width Dropdown Menu
visibility 3076
thumb_up 2
access_time 9 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 ...