EasyManua.ls Logo

Espressif ESP8266 - The Grammar

Espressif ESP8266
51 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
B. The Grammar
The following image describes the grammar of a valid JSON object in a very concise way.
It means that a JSON object knows three basic types:
object
array and
value
JSON grammar
Objects always start and end with curly brackets. They can be either empty (line to the top)
or contain string/value pairs, separated by a colon. These pairs can be repeated by adding a
comma between them. Arrays start and end with square brackets. They can be either empty
or contain a value. At this point we don’t know yet what a value is. Values in an array can be
repeated and must be separated by a comma. Values were already used for the two previous
definitions and here lies the power of this kind of grammar: because a value can contain a
simple text, a number, an object (yes, the object we defined before!!!), an array (also defined
before), booleans or a null value.
This is so powerful because we are reusing the definitions and we are nesting them within
each other: an object can contain a value; a value can contain an array or an object. And
finally, an array can contain a value, repeatedly! Isn’t this beautiful?

Other manuals for Espressif ESP8266

Related product manuals