JSON
No matter you develop on web2 or web3, you need to know about a very important data format, that is JSON (Javascript Object Notation).
Javascript is so prevalent so that its data format becomes the most universal and one for the internet to exchange data.
Its format is very easy to interpreted but Imma throw a guide to you.
JSON uses the notation uses {}
stands for object and []
stands for list,
which can contain another object or list.
JSON allows basic data types like boolean (true
or false
), number (1
) and
string (uses a double quote, like "abc"
).
Object refers to a data structure with attributes (attributes are string mostly), you can see them as key-value-pair, like
{
"a": 1,
"b": 2
}
This object has the attribute "a"
with the value 1
, and attribute "b"
with
the value 2
You can also nest the objects or list like this:
{
"A": {
"a": 1
}
}