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

339
Views
How do I fix "Lexical declaration cannot appear in a single-statement context"

I was making a weather thing using weather.gov API and when I used this code I got an error.

Error:

Uncaught SyntaxError: Lexical declaration cannot appear in a single-statement context

Code:

$.getJSON("https://api.weather.gov/gridpoints/DTX/49,12/forecast", function(data) {
    for (var i = 0; i == 14; i++) {
        if(data['properties']['periods'][i]['name'] == 'Tonight')
        let ex = data['properties']['periods'][i]
    }
});

Every time I look this up I get discord stuff.

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!