- [Greg] Sysco really wants engineers
to be familiar with JavaScript object notation, or JSON.
So I'm going to dig a little deeper.
First, I'll simply take a look at a JSON reply
from DNA center.
It's actually fairly easy to read,
as they are broken down into key, then colon,
then key pairs.
So host name is then followed by the router's host name.
Whenever I see a colon, I know it represents
a single key pair.
The key is the quoted text before the colon.
The key is the name that references a value.
The value is the quoted data returned after the colon.
This could be a text string value
that's double quoted, a numeric value without quotes,
an array, which is a special variable
that contains many values, or an object.
When more than one key pair is returned,
each will be separated by a comma.
Anything contained within curly braces
is considered an object.
Within this object can be one or a series of key pairs.
Values enclosed within square brackets
are part of an array.
An example of an array could be something
like the following.
The array name is food, and values within the array
are tacos, burgers, and pizza.
JSON understanding is good not only for the test,
but can also be useful in other parts
of an engineer's job.