Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
how can i store latitude and longitude values in different variables for api request in javascript?

I wanted to store Latitude and Longitude in 2 different variables so that it can be used in another api request in javascript

let weather={   
        key:"your api key",
        getweather(city){
        fetch(`https://api.openweathermap.org/data/2.5/forecast? 
                q=${city}&appid=${this.key}&units=metric`)
        .then(res => res.json())
        .then(data => this.show(data))
        const encodeurl=encodeURI(fetch);
        },

   show(data){    
        **const{lat,lon}=data.city.coord;**
          console.log(lat,lon);
       }  
  }

 weather.getweather("mumbai"); 
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!