I have this loop, the api returns markers fine, i want to add the url and the image inside the array.
let coordsList = [];
for (let i in markers) {
let coords = markers[i].petLost.lostCoords;
let url = petUrl + markers[i]._id;
let image = petImage + markers[i].imageURL;
coordsList.push(coords);
}
The result with this loop is:
[ 24.728216, 36.2308272 ] , [ 27.728216, 33.2308272 ] , ...
How can i inject in there the url and the image for each corresponding item in the array?
Desired result:
[ 24.728216, 36.2308272, http://blabla.html, http://image.jpg ] ,
[ 27.728216, 33.2308272, http://blabla2.html, http://image2.jpg ]
...