Difference between revisions of ".json"
From Coder Merlin
Aidan-kollar (talk | contribs) |
Aidan-kollar (talk | contribs) |
||
Line 3: | Line 3: | ||
== What is JSON? == | == What is JSON? == | ||
JSON, also known as JavaScript Object Notation, is a text-based, human-readable data interchange format. The filetype used is .json and is based off of a subset of the JavaScript lnaguage. The .json format is completely text-based, and was created back in 2001 by Douglas Crockford. It was later standardized in 2006 through the IETF (Internet Engineering Task Force) under [https://www.ietf.org/rfc/rfc4627.txt | JSON, also known as JavaScript Object Notation, is a text-based, human-readable data interchange format. The filetype used is .json and is based off of a subset of the JavaScript lnaguage. The .json format is completely text-based, and was created back in 2001 by Douglas Crockford. It was later standardized in 2006 through the IETF (Internet Engineering Task Force) under [https://www.ietf.org/rfc/rfc4627.txt RFC 4627] | ||
== Why use JSON? == | == Why use JSON? == |
Revision as of 10:30, 8 September 2021
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Yeet
What is JSON?[edit]
JSON, also known as JavaScript Object Notation, is a text-based, human-readable data interchange format. The filetype used is .json and is based off of a subset of the JavaScript lnaguage. The .json format is completely text-based, and was created back in 2001 by Douglas Crockford. It was later standardized in 2006 through the IETF (Internet Engineering Task Force) under RFC 4627
Why use JSON?[edit]
Because the file format is text only, JSON data can be easily sent between computers and implemented in various ways.
Uses of JSON[edit]
JSON Syntax[edit]
Below is a sample of JSON syntax:
{
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 27,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
}
],
"children": [],
"spouse": null
}
JSON is formatted similar to a dictionary, with key and value pairs.
There are a few key tricks to learning how to read and write in .json files:
- Curly braces {...} contain objects
- Square brackets [...] contain arrays
- Data is stored in name-value pairs separated by a colon, :
- Every data pair and item in an array are separated by a comma ,
- JSON property names must be within quotations "..."
References[edit]
- [What is JSON] (W3 Schools)
- [JSON Introduction] (W3 Schools)
- [Introducing JSON] (JSON)
- [What is JSON?] (Oracle)
- [JSON Tutorial] (RESTful API)
- [What is JSON?] (Codecademy)
- [JSON (Javascript Object Notation)] (TheServerSide)
- [What is JSON?] (Node.js)