'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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
