I’m working with map coordinates in an array . I have:
async function getGeoJSONArr() {
const response = await fetch("http://localhost:3000/data");
const jsonArr = await response.json();
console.log("jsonARR", jsonArr);
const reversedCoords = jsonArr[0].slice().reverse();
I want to get the first array element and reverse it for my leaflet map centerpoint.
I’m getting:
jsonARR [[-110.9617505,32.1853513],[-110.9611676,32.1852037]]
leaflet2.html:41 Uncaught (in promise) TypeError: jsonArr[0].slice(...).reverse is not a function
What am I doing wrong?