I am getting location coordinates when the user touches the map and I want to store old and new coordinates in an array, but every time user gets new coordinates, old coordinates are overwritten.
onMapPress1(event) {
let myArray = []
myArray = [...myArray, event.nativeEvent.coordinate]
console.log(myArray)
}
output: [{"latitude": 28.568736916292988, "longitude": 77.38865587860346}]