There are occasions after I’m working with JavaScript Object Notation (JSON) getting handed or returned from APIs and I have to troubleshoot how I’m parsing the array that’s returned. Nonetheless, 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 helpful so as to indent the hierarchical knowledge after which scroll via 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 simple 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 constructions in a textual content format that may be despatched and obtained over a community.
Supply: JSON
A JSON object is an unordered assortment of key-value pairs, the place every secret’s a string and every worth is usually 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
{
"identify": "John Doe",
"age": 35,
"isMarried": true,
"deal with": {
"road": "123 Predominant St.",
"metropolis": "Anytown",
"state": "CA"
},
"phoneNumbers": [
"555-555-1212",
"555-555-1213"
]
}
On this instance, the JSON object has 5 key-value pairs: "identify"
, "age"
, "isMarried"
, "deal with"
, and "phoneNumbers"
. The worth of "deal with"
is one other JSON object, and the worth of "phoneNumbers"
is an array of strings.
JSON is advantageous as a result of it’s simple 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 fully language-independent however makes use of conventions which can be acquainted to programmers of the C household of languages and is natively supported by C, C++, C#, Java, JavaScript, Perl, PHP, Python, and plenty of others. These properties make JSON a great data-interchange language.