Introduction to JSON

Introduction to JSON

Lesson Details:
November 30, 2020


I: Introduction

A: Json quick introduction to json data javascript using json

It is a lightweight data-interchange format. It is language independent and is used to store structured data. Json is very easy to parse and it is also simple to generate. It is also known as the JavaScript Object Notation. It was developed by Douglas Crockford in the year 2001. It can be converted to a Javascript object.

II: Body

A: Introduction to json

JSON stands for JavaScript Object Notation. JSON is a light-weight data-interchange format. JSON is language independent but uses conventions from JavaScript object syntax for representing object-oriented data structures. JSON has been adopted by major social networking sites, instant messaging services, search engines, and other companies that deal with large-scale data transmission. At its core, JSON consists of two types of objects: an object and an array. These two basic types can be expanded to include many other types of objects. A JSON object consists of comma-separated key value pairs enclosed in curly braces "{ }". An example of a JSON object using this format might look like { "firstName": "Steve", "lastName": "Smith", "age": 42 }. If the values are strings, they need to be enclosed in double quotes ("). If they are numbers, only single quotes (') are needed. However, if you want to use a string that contains a single quote, you will need to escape it by writing it twice - once to denote the beginning of the string and once to denote the end of the string. For example, "He said 'Hello' to me". To convert a JSON object into a JavaScript object, you simply replace all commas with dots (.) and remove the left curly brace. Another example using the JSON object above might look like "Steve"; "Smith"; 42 . The JSON array may contain any number of values separated by commas. An example of a JSON array might look like [ "John", "Peter", "Paul" ]. To convert it into a JavaScript array, you would use square brackets ([]) instead of round brackets (). An example using the JSON array above might look like ["John";"Peter";"Paul"] .

III: Conclusion

loader
Course content