There are occasions after I’m working with JavaScript Object Notation getting handed or returned from APIs and I have to troubleshoot how I’m parsing the array that’s returned. Nevertheless, more often than not it’s tough as a result of it’s only a single string. That’s when a JSON Viewer is available in very useful so to indent the hierarchical knowledge after which scroll by way of to seek out out the data you want.
What’s JavaScript Object Notation (JSON)?
JSON (JavaScript Object Notation) is a light-weight data-interchange format that’s straightforward for people to learn and write and straightforward for machines to parse and generate. It’s based mostly on a subset of the JavaScript programming language, and is used to symbolize knowledge buildings in a textual content format that may be despatched and acquired over a community.
Supply: JSON
A JSON object is an unordered assortment of key-value pairs, the place every secret is a string and every worth could be a string, quantity, boolean, null, array, or one other JSON object. The important thing-value pairs are separated by commas and surrounded by curly braces {}
.
JSON Instance
{
"title": "John Doe",
"age": 35,
"isMarried": true,
"handle": {
"avenue": "123 Principal St.",
"metropolis": "Anytown",
"state": "CA"
},
"phoneNumbers": [
"555-555-1212",
"555-555-1213"
]
}
JSON is advantageous as a result of it’s straightforward for machines to parse and generate. It’s based mostly on a subset of the JavaScript Programming Language Normal ECMA-262 third Version – December 1999. JSON is a textual content format that’s utterly language-independent however makes use of conventions which are acquainted to programmers of the C household of languages and is natively supported by C, C++, C#, Java, JavaScript, Perl, PHP, Python, and lots of others. These properties make JSON a super data-interchange language.