I am encountering a situation where I need to extract data from an API using an https.get request. The issue arises when the json path starts with a 0. Can anyone explain what this means and how can I access the data successfully?
https.get(url, function(response) {
response.on("data", function(data) {
readableData = JSON.parse(data);
length = readableData.0.length; // <-- attempting to use path (0.length) is causing issues
The specific path causing trouble is 0.length and it results in an error on the json chart viewer.
Here is a snippet of the data as shown in the json viewer:
[
{
"length": "32260db8-40d3-4973-9031-ceef149189aa",
}
]