Read very literally

What is your hint or solution suggestion?

First of all, there was a reported bug regarding the API for this particular set of problems. A thread to try and eliminate a potential bug is here: Get JSON with the JavaScript XMLHttpRequest Method

I decided to just replace the /json/cats.json in

req.open("GET",'/json/cats.json', true);

with https://www.freecodecamp.org/json/cats.json to eliminate any potential issue with the API.

After I was able to access the data I realized that I was wrong in trying to collect the data. I was approaching it like this: console.log(json.codeNames[2]). Even if the API was working this naturally returns undefined.

So like the title of this thread says, read the task very literally verbatim:

Challenge: Access the JSON Data from an API
For the cat with the "id" of 2, print to the console the second value in the codeNames array. You should use bracket and dot notation on the object (which is saved in the variable json) to access the value.

Solution:
After reading this a few times it made sense to me what I was doing wrong.

console.log(json[2].codeNames[1])

Link to the challenge: