I am trying to access information from a JSON API call to store the data into an array and use it further. This is an example API call example API . I am trying to access the "iaqi" proberty which is an object of objects. I need the integer values from it like 9,53,10,102... etc. I wrote the following code to convert it into an array of objects named as dataArray and then further iterated over it to get seperate key: value pairs.
const dataArray = Object.values(response.body.data.iaqi);
const iterator = dataArray.entries();
for(const[index, element] of iterator){
console.log(element)
}
which gave me the following output :-
Is there any way I can access the individual number values and store them in an array? Any help will be appreciated and please correct me if I did something wrong as I'm new here.