Json

 JSON

  • JSON (JavaScript Object Notation).
  • JSON  is a lightweight  that's easy for humans to read and write, and easy to findout .
  •  machines to parse and generate.
  •  It is often used for transmitting data in web applications.

Data Types:

  • Object: 

    • A collection of key-value pairs, similar to a dictionary or a map. In JSON, an object is represented with curly braces {}.
  • Syntax Rules:

{
  "name": "John",
  "age": 30,
  "isStudent": false
}


  • Array: 
    • An ordered list of values, similar to a list or an array. In JSON, an array is represented with square brackets [].
  • Syntax Rules:
    • Arrays: Contain values separated by commas.

[
  "apple",
  "banana",
  "cherry"
]


  • String:
    • A sequence of characters, surrounded by double quotes " ".
  • Syntax Rules:
    • Strings: Enclosed in double quotes.

"Hello, World!"

        
  • Number:
    • A numerical value. JSON does not differentiate between integers and floating-point numbers.
  • Syntax Rules:
    • Numbers: Written without quotes.


76
  • Boolean:
    • Can be either true or false.
  • Null: Represents an empty or undefined value.

Comments

Popular posts from this blog

CSS interview question

HTML

Angular full tutorial