0

I have the following function which returns the below object (see screenshot). Nevertheless, I am not able to deconstruct the city, postcode, state, or country, while it works for lat and lng, any reason why?

        const locationObj = {
            error:false,
            errorMessage:'',
            lat:'',
            lng:'',
            city:'',
            state:'',
            country:'',
            postcode:'',
        }
        const res =  await requestUserLocation(locationObj)
        if(res.error){
            return null
        }
        console.log('this is the response',res)
        console.log('this is the response city',res.city)

enter image description here

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Zizo
  • 19
  • 3

0 Answers0