mercredi 8 avril 2020

How can I throw an error message with an if statement when typing a country wrongly in a search bar (TypeError) using an api?

What I'm looking for is just the logic of the error happening. I mean something like that:

if (Typeerror) {myMessage.innerText = `Invalid country name`}

Obviously this is wrong. Is there any simple answer for this?

Aucun commentaire:

Enregistrer un commentaire