What is JSON and Advantages of JSON



①JSON overview

  1. JSON stands for JavaScript Object Notation.
  2. JSON is lightweight data-interchange format.
  3. JSON is easy to read and write than XML.
  4. JSON is language independent.
  5. JSON supports array, object, string, number and values.
  6. Data of null, boolean value, numeric value, character string, array, object (associative array) can be represented by character string
  7. Arrays and objects (associative arrays) can be expressed in a nested (nested) structure
  8. If you write null, you can express a null value
  9. Data is a pair of key and value
  10. Data is separated by commas
  11. In the curly brackets {}, objects
  12. Array in brackets []

② JSON sample

{ "firstName":"Tom" , "lastName":"Welch" }
  • “firstName” and “lastName” are Key
  • “Tom”and “Welch” are value
  • Since value is a character string, it is surrounded by “”

③ Advantages of JSON

  • By using JSON instead of XML, there is a merit that it can reduce the amount of data during communication compared to redundant XML.
  • JSON can be used as a data format for exchanging data beyond language as well as JavaScript.

(4) JSON is built on two structures:

  • A collection of name/value pairs: In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
  • An ordered list of values: In most languages, this is realized as an array, vector, list, or sequence.