JimYuan's Blog

Sharing the things I learned

0%

JSON_FirstGlance

I just finished this quick introduction of JSON video, and it was so helpful.
Here is the link:
https://www.youtube.com/watch?v=iiADhChRriM&t=553s

Several things I would like to take away from this lesson:

The most important thing might be this one:

Everything in JSON is VALID in JavaScript


JaveScript Object Notation

  • Data Representation Format
  • Commonly Used for APIs and Configs
  • Lightweight and Easy to Read/Write
  • Integrate Easily With Most Language

JSON Types

  • Strings
  • Number
  • Booleans
  • null
  • Array
  • Object

Example

user.json
{
“name”: “Kyle”,
“favoriteNumber”: 3,
“isProgrammer”: true,
“hobbies”: [“Weight Lifting”, “Bowling”],
“friends”: [{
“name”: “Joey”,
“favoriteNumber”: 100,
“isProgrammer”: false,
“friends”: […]
}]
}

How to Parse from string to JSON

JSON.Parse(string)