Skip to content
Advertisement

Cant figure out why I cant retrieve data from my API

When I type a city name into my search bar it should pull up information on the weather on that city but I get a 400 bad request error
JAVASCRIPT:

JavaScript

Advertisement

Answer

You are using a promise incorrectly. The correct syntax is .then(result => {}).catch(e => {})

Like this

JavaScript
Advertisement