Hi @Nathan_Zhang, and welcome to the community.
So, the json
object passed to the displayResults()
function is a JS object representation of some JSON data passed to our app from the NYTimes API. We are using dot syntax to access the docs
property of the response
property of the top-level json
object. These response
sub-property is itself a JS object, whereas docs
is an array (you can tell this because later on we use let current = articles[i];
) or objects, each one representing a single news article. These values are nested inside one another.
The structure of the json
object will look something like this:
{
response : {
docs : [
... ,
... ,
... ,
]
}
}
Have you worked through our JS objects module? This examples a lot of these basics, plus a lot more: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects