Here is the code snippet I am working with:
let data = res.data.data;
console.log('data: ', data)
const list = [];
for(let i = 0; i < data.length; i++){
console.log('data i: ', data[i]) //this line is not being printed in the console
list.push({
lat: data[i].latitude,
lng: data[i].longitude,
histories: data[i].histories,
})
lineString.pushPoint({
lat:data[i].longitude,
lng:data[i].latitude
})
}
console.log('list: ', list)
The above code returns the following results:
https://i.sstatic.net/3PFPI.png
Even though my data
variable contains all the results, nothing seems to be pushed into the list
array.
What could be causing the filtered data not to go into the list array?