[JavaScript] Asynchronous JavaScript: Promises, Async/Await, and AJAX - Handling Rejected Promises
First example of catching error
const getCountryData = function (country) {
// country 1
fetch(`https://restcountries.com/v2/name/${country}`)
.then(
response => response.json()
err => alert(err) // catching error (chain stop her...
jaydenjpark.hashnode.dev2 min read