Below is the response from the backend :
results = [{
"name": "FantasticBeasts",
"count": 546809,
},
{
"name": "SSIPOS",
"count": 16257,
},
{
"name": "xyz",
"count": 16257,
}
]
for (var i = 0; i <= results.length; i++) {
console.log('result ==>', results[i]);
}
My end goal is to fetch the name from every element of the array. But before that, I need to iterate over the array elements. But I am unable to iterate through the array elements.
result ==> undefined
i < results.length;as index starts from0