Table of Contents
Guide Purpose:
- This guide IS designed to:
- Explain JSON
- Give description of JSON Values
- This guide IS NOT designed to:
- Show what JSON is used for in its entity
What is JSON
JavaScript Object Notation (JSON) is a JavaScript format for storing and exchanging data which is embraced by other programming language. It helps with communicating data in strings from the server to a webpage. The JSON syntax rules is a key fundamental to how we can understand the codes that are being written and the format in which a value should be done.
JSON Syntax Rules
- Data is in name/value pairs
- For example: “firstname”:”John”
- Data is separated by commas
- For example: {“firstname”:”John”, “Lastname”:”Doe”}
- Curly braces hold objects
- For example: {“firstname”:”John”, “Lastname”:”Doe”}
- Square brackets hold array
- For example: “employee”: [ {“firstname”:”John”, “Lastname”:”Doe”} ]
JSON Values Data Type
JSON Strings
These are sets of characters wrapped in double-quotes as seen in the image below
JSON Numbers
Number values are in integer or a floating-point as seen in the image below
JSON Booleans
Boolean values are true or false in JSON as seen in the image below
JSON Null
Null values mean empty words as seen in the image below
JSON Objects
Objects are any number of key-values wrapped in curly braces as seen in the image below
JSON Arrays
Arrays are any number of objects wrapped in square brackets as seen in the image below