JSON Intro
(JavaScript Object Notation)
{
name: "Bob",
age: 32,
favoriteColors: ["green", "blue", "red"],
address: {
street: "123 Test St.",
street2: "Unit A",
city: "Seattle",
state: "Washington",
country: "United States of America",
zipCode: 12345
}
}
Why learn how to read JSON?
- Common means of communicating data
- We use it for:
- Web
- App
- Salesforce
- All things internet
- If you read JSON you’ll more easily understand the web side of things (especially when looking at bugs or understanding data)
Basics of JSON
- Made of keys and values
- Values can be
- Strings (text)
- Numbers
- Arrays (a list)
- Boolean (true or false)
- Null (like an empty value)
- Another object
Spreadsheet analogy
-
Column titles are keys
- Cells are values
- Rows are items in an array
- No nested values
Name | Age |
---|---|
Bob | 32 |
Sam | 19 |
Chuck | 45 |
{
name: "Bob",
age: 32,
favoriteColors: ["green", "blue", "red"],
address: {
street: "123 Test St.",
street2: "Unit A",
city: "Seattle",
state: "Washington",
country: "United States of America",
zipCode: 12345
}
}
Example
JSON Intro
By Alex Hughes
JSON Intro
- 63