0 votes
in JSON by

What are the advantages of JSON over XML?

1 Answer

0 votes
by

JSON has emerged as one of the most popular data interchange methods. It has several advantages over the XML that has to help it to replace XML as a most popular data transfer format.

JSON is lighter and faster than the XML.

JSON has object types but XML doesn’t define objects as types. JSON has different object type for a different set of data such as string, integer, Boolean, array, etc. All XML objects are categorized as just one data type, i.e. string.

JSON data can be easily accessed as a JSON object using JavaScript. On the other hand, the XML data need to be parsed and allocated to the variables using APIs. Getting value out of a JSON is as easy as reading an object from your JavaScript programming.

This text-based lightweight nature makes JSON more accessible and useful than XML.

Related questions

0 votes
asked Jul 19, 2020 in JSON by SakshiSharma
0 votes
asked Jul 21, 2020 in JSON by SakshiSharma
...